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.
---
src/mesa/state_tracker/st_draw.c | 3 ---
src/mesa/state_tracker/st_draw_feedback.c | 1 -
2 files changed, 4 deletions(-)
(limited to 'src/mesa')
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/mesa')
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/mesa')
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 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/mesa')
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/mesa')
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/mesa')
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 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/mesa')
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 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/mesa')
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/mesa')
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 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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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 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/mesa')
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 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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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 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/mesa')
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/mesa')
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/mesa')
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/mesa')
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 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/mesa')
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 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/mesa')
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 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/mesa')
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 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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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 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/mesa')
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 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/mesa')
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 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/mesa')
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 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/mesa')
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/mesa')
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/mesa')
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 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/mesa')
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 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/mesa')
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/mesa')
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/mesa')
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/mesa')
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 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/mesa')
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 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/mesa')
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/mesa')
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 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/mesa')
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 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/mesa')
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 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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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 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/mesa')
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 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/mesa')
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/mesa')
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 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/mesa')
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/mesa')
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 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/mesa')
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 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/mesa')
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 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/mesa')
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/mesa')
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/mesa')
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/mesa')
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 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/mesa')
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/mesa')
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/mesa')
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 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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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 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/mesa')
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/mesa')
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/mesa')
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/mesa')
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/mesa')
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;i