summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/Makefile6
-rw-r--r--src/mesa/drivers/dri/common/extension_helper.h20
-rw-r--r--src/mesa/drivers/dri/i915/intel_pixel.c22
-rw-r--r--src/mesa/drivers/dri/i915tex/i830_vtbl.c12
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_pixel_draw.c17
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c6
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_bufferobj.h2
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_buffers.c10
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_context.c4
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_context.h13
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_fifo.c14
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_object.c59
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_object.h14
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_query.c9
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_screen.c2
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_span.c5
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_state.c4
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_sync.c67
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_sync.h32
-rw-r--r--src/mesa/drivers/dri/nouveau/nv10_swtcl.c45
-rw-r--r--src/mesa/drivers/dri/nouveau/nv30_state.c52
-rw-r--r--src/mesa/drivers/dri/r300/r300_context.h17
-rw-r--r--src/mesa/drivers/dri/r300/r300_reg.h8
-rw-r--r--src/mesa/drivers/dri/r300/r300_state.c296
-rw-r--r--src/mesa/drivers/dri/r300/radeon_lock.h3
-rw-r--r--src/mesa/drivers/windows/gdi/wgl.c6
-rw-r--r--src/mesa/drivers/windows/gdi/wmesa.c132
-rw-r--r--src/mesa/glapi/gl_API.xml21
-rw-r--r--src/mesa/glapi/glapitemp.h30
-rw-r--r--src/mesa/glapi/glprocs.h282
-rw-r--r--src/mesa/main/config.h2
-rw-r--r--src/mesa/main/glheader.h3
-rw-r--r--src/mesa/main/imports.c4
-rw-r--r--src/mesa/main/points.c1
-rw-r--r--src/mesa/main/teximage.c34
-rw-r--r--src/mesa/sparc/glapi_sparc.S5
-rw-r--r--src/mesa/swrast/s_aalinetemp.h4
-rw-r--r--src/mesa/swrast/s_aatritemp.h3
-rw-r--r--src/mesa/swrast/s_accum.c4
-rw-r--r--src/mesa/swrast/s_bitmap.c8
-rw-r--r--src/mesa/swrast/s_buffers.c8
-rw-r--r--src/mesa/swrast/s_context.c7
-rw-r--r--src/mesa/swrast/s_copypix.c16
-rw-r--r--src/mesa/swrast/s_drawpix.c17
-rw-r--r--src/mesa/swrast/s_feedback.c7
-rw-r--r--src/mesa/swrast/s_linetemp.h5
-rw-r--r--src/mesa/swrast/s_points.c653
-rw-r--r--src/mesa/swrast/s_pointtemp.h406
-rw-r--r--src/mesa/swrast/s_span.c25
-rw-r--r--src/mesa/swrast/s_span.h18
-rw-r--r--src/mesa/swrast/s_tritemp.h2
-rw-r--r--src/mesa/swrast/s_zoom.c22
-rw-r--r--src/mesa/swrast_setup/ss_context.c5
-rw-r--r--src/mesa/tnl/t_save_api.c1834
-rw-r--r--src/mesa/vbo/vbo_exec_api.c5
-rw-r--r--src/mesa/vbo/vbo_save_api.c4
-rw-r--r--src/mesa/x86-64/glapi_x86-64.S5
-rw-r--r--src/mesa/x86/glapi_x86.S6
58 files changed, 1201 insertions, 3122 deletions
diff --git a/src/mesa/Makefile b/src/mesa/Makefile
index c03c5f80ff..6943219036 100644
--- a/src/mesa/Makefile
+++ b/src/mesa/Makefile
@@ -176,9 +176,9 @@ clean:
-rm -f */*/*.o
-rm -f depend depend.bak libmesa.a
-rm -f drivers/*/*.o
- (cd drivers/dri ; $(MAKE) clean)
- (cd x86 ; $(MAKE) clean)
- (cd x86-64 ; $(MAKE) clean)
+ (cd drivers/dri && $(MAKE) clean)
+ (cd x86 && $(MAKE) clean)
+ (cd x86-64 && $(MAKE) clean)
include depend
diff --git a/src/mesa/drivers/dri/common/extension_helper.h b/src/mesa/drivers/dri/common/extension_helper.h
index 10f75edaaa..bf103a3931 100644
--- a/src/mesa/drivers/dri/common/extension_helper.h
+++ b/src/mesa/drivers/dri/common/extension_helper.h
@@ -1478,9 +1478,10 @@ static const char ImageTransformParameterfvHP_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4ivARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib4iv\0"
"glVertexAttrib4ivARB\0"
"";
#endif
@@ -1586,9 +1587,10 @@ static const char PixelTransformParameterfvEXT_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4bvARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib4bv\0"
"glVertexAttrib4bvARB\0"
"";
#endif
@@ -2391,9 +2393,10 @@ static const char GetAttribLocationARB_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4ubvARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib4ubv\0"
"glVertexAttrib4ubvARB\0"
"";
#endif
@@ -2910,9 +2913,10 @@ static const char ReplacementCodeuiColor4ubVertex3fSUN_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4usvARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib4usv\0"
"glVertexAttrib4usvARB\0"
"";
#endif
@@ -4393,9 +4397,10 @@ static const char WindowPos4iMESA_names[] =
"";
#endif
-#if defined(need_GL_ARB_vertex_program)
+#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program)
static const char VertexAttrib4uivARB_names[] =
"ip\0" /* Parameter signature */
+ "glVertexAttrib4uiv\0"
"glVertexAttrib4uivARB\0"
"";
#endif
@@ -6257,6 +6262,8 @@ static const struct dri_extension_function GL_VERSION_2_0_functions[] = {
{ GetVertexAttribivARB_names, GetVertexAttribivARB_remap_index, -1 },
{ CreateProgram_names, CreateProgram_remap_index, -1 },
{ StencilFuncSeparate_names, StencilFuncSeparate_remap_index, -1 },
+ { VertexAttrib4ivARB_names, VertexAttrib4ivARB_remap_index, -1 },
+ { VertexAttrib4bvARB_names, VertexAttrib4bvARB_remap_index, -1 },
{ VertexAttrib3dARB_names, VertexAttrib3dARB_remap_index, -1 },
{ VertexAttrib4fARB_names, VertexAttrib4fARB_remap_index, -1 },
{ VertexAttrib4fvARB_names, VertexAttrib4fvARB_remap_index, -1 },
@@ -6270,6 +6277,7 @@ static const struct dri_extension_function GL_VERSION_2_0_functions[] = {
{ VertexAttrib1dvARB_names, VertexAttrib1dvARB_remap_index, -1 },
{ GetVertexAttribfvARB_names, GetVertexAttribfvARB_remap_index, -1 },
{ GetAttribLocationARB_names, GetAttribLocationARB_remap_index, -1 },
+ { VertexAttrib4ubvARB_names, VertexAttrib4ubvARB_remap_index, -1 },
{ Uniform3ivARB_names, Uniform3ivARB_remap_index, -1 },
{ VertexAttrib4sARB_names, VertexAttrib4sARB_remap_index, -1 },
{ VertexAttrib2dvARB_names, VertexAttrib2dvARB_remap_index, -1 },
@@ -6282,6 +6290,7 @@ static const struct dri_extension_function GL_VERSION_2_0_functions[] = {
{ VertexAttrib4NuivARB_names, VertexAttrib4NuivARB_remap_index, -1 },
{ Uniform4fARB_names, Uniform4fARB_remap_index, -1 },
{ VertexAttrib1dARB_names, VertexAttrib1dARB_remap_index, -1 },
+ { VertexAttrib4usvARB_names, VertexAttrib4usvARB_remap_index, -1 },
{ LinkProgramARB_names, LinkProgramARB_remap_index, -1 },
{ ShaderSourceARB_names, ShaderSourceARB_remap_index, -1 },
{ VertexAttrib3svARB_names, VertexAttrib3svARB_remap_index, -1 },
@@ -6311,6 +6320,7 @@ static const struct dri_extension_function GL_VERSION_2_0_functions[] = {
{ DrawBuffersARB_names, DrawBuffersARB_remap_index, -1 },
{ Uniform1fvARB_names, Uniform1fvARB_remap_index, -1 },
{ EnableVertexAttribArrayARB_names, EnableVertexAttribArrayARB_remap_index, -1 },
+ { VertexAttrib4uivARB_names, VertexAttrib4uivARB_remap_index, -1 },
{ VertexAttrib4svARB_names, VertexAttrib4svARB_remap_index, -1 },
{ GetShaderiv_names, GetShaderiv_remap_index, -1 },
{ VertexAttrib2svARB_names, VertexAttrib2svARB_remap_index, -1 },
diff --git a/src/mesa/drivers/dri/i915/intel_pixel.c b/src/mesa/drivers/dri/i915/intel_pixel.c
index 535cbfcb26..d175870a0c 100644
--- a/src/mesa/drivers/dri/i915/intel_pixel.c
+++ b/src/mesa/drivers/dri/i915/intel_pixel.c
@@ -439,10 +439,26 @@ intelDrawPixels( GLcontext *ctx,
if (INTEL_DEBUG & DEBUG_PIXEL)
fprintf(stderr, "%s\n", __FUNCTION__);
- if (!intelTryDrawPixels( ctx, x, y, width, height, format, type,
- unpack, pixels ))
+ if (intelTryDrawPixels( ctx, x, y, width, height, format, type,
+ unpack, pixels ))
+ return;
+
+ if (ctx->FragmentProgram._Current == ctx->FragmentProgram._TexEnvProgram) {
+ /*
+ * We don't want the i915 texenv program to be applied to DrawPixels.
+ * This is really just a performance optimization (mesa will other-
+ * wise happily run the fragment program on each pixel in the image).
+ */
+ struct gl_fragment_program *fpSave = ctx->FragmentProgram._Current;
+ ctx->FragmentProgram._Current = NULL;
+ _swrast_DrawPixels( ctx, x, y, width, height, format, type,
+ unpack, pixels );
+ ctx->FragmentProgram._Current = fpSave;
+ }
+ else {
_swrast_DrawPixels( ctx, x, y, width, height, format, type,
- unpack, pixels );
+ unpack, pixels );
+ }
}
diff --git a/src/mesa/drivers/dri/i915tex/i830_vtbl.c b/src/mesa/drivers/dri/i915tex/i830_vtbl.c
index dd0670dec3..e432648ada 100644
--- a/src/mesa/drivers/dri/i915tex/i830_vtbl.c
+++ b/src/mesa/drivers/dri/i915tex/i830_vtbl.c
@@ -490,11 +490,13 @@ i830_emit_state(struct intel_context *intel)
DRM_BO_MASK_MEM | DRM_BO_FLAG_READ,
state->tex_offset[i] | TM0S0_USE_FENCE);
}
- else {
- assert(i == 0);
- assert(state == &i830->meta);
- OUT_BATCH(0);
- }
+ else if (state == &i830->meta) {
+ assert(i == 0);
+ OUT_BATCH(0);
+ }
+ else {
+ OUT_BATCH(state->tex_offset[i]);
+ }
OUT_BATCH(state->Tex[i][I830_TEXREG_TM0S1]);
OUT_BATCH(state->Tex[i][I830_TEXREG_TM0S2]);
diff --git a/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c b/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c
index 10a079896a..77c67c821e 100644
--- a/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c
+++ b/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c
@@ -363,5 +363,20 @@ intelDrawPixels(GLcontext * ctx,
if (INTEL_DEBUG & DEBUG_PIXEL)
_mesa_printf("%s: fallback to swrast\n", __FUNCTION__);
- _swrast_DrawPixels(ctx, x, y, width, height, format, type, unpack, pixels);
+ if (ctx->FragmentProgram._Current == ctx->FragmentProgram._TexEnvProgram) {
+ /*
+ * We don't want the i915 texenv program to be applied to DrawPixels.
+ * This is really just a performance optimization (mesa will other-
+ * wise happily run the fragment program on each pixel in the image).
+ */
+ struct gl_fragment_program *fpSave = ctx->FragmentProgram._Current;
+ ctx->FragmentProgram._Current = NULL;
+ _swrast_DrawPixels( ctx, x, y, width, height, format, type,
+ unpack, pixels );
+ ctx->FragmentProgram._Current = fpSave;
+ }
+ else {
+ _swrast_DrawPixels( ctx, x, y, width, height, format, type,
+ unpack, pixels );
+ }
}
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c b/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c
index 684ed7b017..fc14060c04 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c
@@ -41,7 +41,7 @@ nouveau_bo_download_from_screen(GLcontext *ctx, GLuint offset, GLuint size,
DEBUG("..sys_mem\n");
in_mem = nouveau_mem_alloc(ctx, NOUVEAU_MEM_AGP, size, 0);
if (in_mem) {
- DEBUG("....via AGP\n");
+ DEBUG("....via GART\n");
/* otherwise, try blitting to faster memory and
* copying from there
*/
@@ -86,7 +86,7 @@ nouveau_bo_upload_to_screen(GLcontext *ctx, GLuint offset, GLuint size,
NOUVEAU_MEM_MAPPED,
size, 0);
if (out_mem) {
- DEBUG("....via AGP\n");
+ DEBUG("....via GART\n");
_mesa_memcpy(out_mem->map,
nbo->cpu_mem_sys + offset, size);
nouveau_memformat_flat_emit(ctx, nbo->gpu_mem, out_mem,
@@ -511,7 +511,7 @@ nouveauBufferData(GLcontext *ctx, GLenum target, GLsizeiptrARB size,
gpu_flags = 0;
break;
default:
- gpu_flags = NOUVEAU_BO_VRAM_OK | NOUVEAU_BO_AGP_OK;
+ gpu_flags = NOUVEAU_BO_VRAM_OK | NOUVEAU_BO_GART_OK;
break;
}
nouveau_bo_init_storage(ctx, gpu_flags, size, data, usage, obj);
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.h b/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.h
index 932450fd87..3439a35e7c 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.h
+++ b/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.h
@@ -5,7 +5,7 @@
#include "nouveau_buffers.h"
#define NOUVEAU_BO_VRAM_OK (NOUVEAU_MEM_FB | NOUVEAU_MEM_FB_ACCEPTABLE)
-#define NOUVEAU_BO_AGP_OK (NOUVEAU_MEM_AGP | NOUVEAU_MEM_AGP_ACCEPTABLE)
+#define NOUVEAU_BO_GART_OK (NOUVEAU_MEM_AGP | NOUVEAU_MEM_AGP_ACCEPTABLE)
typedef struct nouveau_bufferobj_region_t {
uint32_t start;
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_buffers.c b/src/mesa/drivers/dri/nouveau/nouveau_buffers.c
index b54f68f402..857cd30584 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_buffers.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_buffers.c
@@ -32,8 +32,8 @@ nouveau_memformat_flat_emit(GLcontext *ctx,
return GL_FALSE;
}
- src_handle = (src->type & NOUVEAU_MEM_FB) ? NvDmaFB : NvDmaAGP;
- dst_handle = (dst->type & NOUVEAU_MEM_FB) ? NvDmaFB : NvDmaAGP;
+ src_handle = (src->type & NOUVEAU_MEM_FB) ? NvDmaFB : NvDmaTT;
+ dst_handle = (dst->type & NOUVEAU_MEM_FB) ? NvDmaFB : NvDmaTT;
src_offset += nouveau_mem_gpu_offset_get(ctx, src);
dst_offset += nouveau_mem_gpu_offset_get(ctx, dst);
@@ -138,7 +138,7 @@ nouveau_mem_gpu_offset_get(GLcontext *ctx, nouveau_mem *mem)
if (mem->type & NOUVEAU_MEM_FB)
return (uint32_t)mem->offset - nmesa->vram_phys;
else if (mem->type & NOUVEAU_MEM_AGP)
- return (uint32_t)mem->offset - nmesa->agp_phys;
+ return (uint32_t)mem->offset - nmesa->gart_phys;
else
return 0xDEADF00D;
}
@@ -299,6 +299,8 @@ nouveau_cliprects_drawable_set(nouveauContextPtr nmesa,
nmesa->pClipRects = dPriv->pClipRects;
nmesa->drawX = dPriv->x;
nmesa->drawY = dPriv->y;
+ nmesa->drawW = dPriv->w;
+ nmesa->drawH = dPriv->h;
}
static void
@@ -313,6 +315,8 @@ nouveau_cliprects_renderbuffer_set(nouveauContextPtr nmesa,
nmesa->osClipRect.y2 = nrb->mesa.Height;
nmesa->drawX = 0;
nmesa->drawY = 0;
+ nmesa->drawW = nrb->mesa.Width;
+ nmesa->drawH = nrb->mesa.Height;
}
void
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c
index 8e11eb6134..d96b00242c 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_context.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c
@@ -145,10 +145,10 @@ GLboolean nouveauCreateContext( const __GLcontextModes *glVisual,
&nmesa->vram_size))
return GL_FALSE;
if (!nouveauDRMGetParam(nmesa, NOUVEAU_GETPARAM_AGP_PHYSICAL,
- &nmesa->agp_phys))
+ &nmesa->gart_phys))
return GL_FALSE;
if (!nouveauDRMGetParam(nmesa, NOUVEAU_GETPARAM_AGP_SIZE,
- &nmesa->agp_size))
+ &nmesa->gart_size))
return GL_FALSE;
if (!nouveauFifoInit(nmesa))
return GL_FALSE;
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h
index 87e4479da3..10d2ed6e17 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_context.h
+++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h
@@ -99,19 +99,22 @@ typedef struct nouveau_context {
/* The read-only regs */
volatile unsigned char* mmio;
+ /* The per-channel notifier block */
+ volatile void *notifier_block;
+
/* Physical addresses of AGP/VRAM apertures */
uint64_t vram_phys;
uint64_t vram_size;
- uint64_t agp_phys;
- uint64_t agp_size;
+ uint64_t gart_phys;
+ uint64_t gart_size;
/* Channel synchronisation */
- nouveau_notifier *syncNotifier;
+ drm_nouveau_notifier_alloc_t *syncNotifier;
/* ARB_occlusion_query / EXT_timer_query */
GLuint query_object_max;
GLboolean * query_alloc;
- nouveau_notifier *queryNotifier;
+ drm_nouveau_notifier_alloc_t *queryNotifier;
/* Additional hw-specific functions */
nouveau_hw_func hw_func;
@@ -150,7 +153,7 @@ typedef struct nouveau_context {
GLuint numClipRects;
drm_clip_rect_t *pClipRects;
drm_clip_rect_t osClipRect;
- GLuint drawX, drawY;
+ GLuint drawX, drawY, drawW, drawH;
/* The rendering context information */
GLenum current_primitive; /* the current primitive enum */
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_fifo.c b/src/mesa/drivers/dri/nouveau/nouveau_fifo.c
index bd2b2eddd0..e9320918f9 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_fifo.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_fifo.c
@@ -99,13 +99,14 @@ void nouveauWaitForIdle(nouveauContextPtr nmesa)
GLboolean nouveauFifoInit(nouveauContextPtr nmesa)
{
drm_nouveau_fifo_alloc_t fifo_init;
- int i;
+ int i, ret;
#ifdef NOUVEAU_RING_DEBUG
return GL_TRUE;
#endif
- int ret;
+ fifo_init.fb_ctxdma_handle = NvDmaFB;
+ fifo_init.tt_ctxdma_handle = NvDmaTT;
ret=drmCommandWriteRead(nmesa->driFd, DRM_NOUVEAU_FIFO_ALLOC, &fifo_init, sizeof(fifo_init));
if (ret) {
FATAL("Fifo initialization ioctl failed (returned %d)\n",ret);
@@ -117,12 +118,21 @@ GLboolean nouveauFifoInit(nouveauContextPtr nmesa)
FATAL("Unable to map the fifo (returned %d)\n",ret);
return GL_FALSE;
}
+
ret = drmMap(nmesa->driFd, fifo_init.ctrl, fifo_init.ctrl_size, &nmesa->fifo.mmio);
if (ret) {
FATAL("Unable to map the control regs (returned %d)\n",ret);
return GL_FALSE;
}
+ ret = drmMap(nmesa->driFd, fifo_init.notifier,
+ fifo_init.notifier_size,
+ &nmesa->notifier_block);
+ if (ret) {
+ FATAL("Unable to map the notifier block (returned %d)\n",ret);
+ return GL_FALSE;
+ }
+
/* Setup our initial FIFO tracking params */
nmesa->fifo.channel = fifo_init.channel;
nmesa->fifo.put_base = fifo_init.put_base;
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_object.c b/src/mesa/drivers/dri/nouveau/nouveau_object.c
index b71acff430..69f8dbf794 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_object.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_object.c
@@ -7,61 +7,18 @@
GLboolean nouveauCreateContextObject(nouveauContextPtr nmesa,
uint32_t handle, int class)
{
- drm_nouveau_object_init_t cto;
+ drm_nouveau_grobj_alloc_t cto;
int ret;
cto.channel = nmesa->fifo.channel;
cto.handle = handle;
cto.class = class;
- ret = drmCommandWrite(nmesa->driFd, DRM_NOUVEAU_OBJECT_INIT, &cto, sizeof(cto));
+ ret = drmCommandWrite(nmesa->driFd, DRM_NOUVEAU_GROBJ_ALLOC,
+ &cto, sizeof(cto));
return ret == 0;
}
-GLboolean nouveauCreateDmaObject(nouveauContextPtr nmesa,
- uint32_t handle,
- int class,
- uint32_t offset,
- uint32_t size,
- int target,
- int access)
-{
- drm_nouveau_dma_object_init_t dma;
- int ret;
-
- dma.channel = nmesa->fifo.channel;
- dma.class = class;
- dma.handle = handle;
- dma.target = target;
- dma.access = access;
- dma.offset = offset;
- dma.size = size;
- ret = drmCommandWriteRead(nmesa->driFd, DRM_NOUVEAU_DMA_OBJECT_INIT,
- &dma, sizeof(dma));
- return ret == 0;
-}
-
-GLboolean nouveauCreateDmaObjectFromMem(nouveauContextPtr nmesa,
- uint32_t handle, int class,
- nouveau_mem *mem,
- int access)
-{
- uint32_t offset = mem->offset;
- int target = mem->type & (NOUVEAU_MEM_FB | NOUVEAU_MEM_AGP);
-
- if (!target)
- return GL_FALSE;
-
- if (target & NOUVEAU_MEM_FB)
- offset -= nmesa->vram_phys;
- else if (target & NOUVEAU_MEM_AGP)
- offset -= nmesa->agp_phys;
-
- return nouveauCreateDmaObject(nmesa, handle, class,
- offset, mem->size,
- target, access);
-}
-
void nouveauObjectOnSubchannel(nouveauContextPtr nmesa, int subchannel, int handle)
{
BEGIN_RING_SIZE(subchannel, 0, 1);
@@ -74,16 +31,6 @@ void nouveauObjectInit(nouveauContextPtr nmesa)
return;
#endif
-/* We need to know vram size.. and AGP size (and even if the card is AGP..) */
- nouveauCreateDmaObject( nmesa, NvDmaFB, NV_DMA_IN_MEMORY,
- 0, nmesa->vram_size,
- NOUVEAU_MEM_FB,
- NOUVEAU_MEM_ACCESS_RW);
- nouveauCreateDmaObject( nmesa, NvDmaAGP, NV_DMA_IN_MEMORY,
- 0, nmesa->agp_size,
- NOUVEAU_MEM_AGP,
- NOUVEAU_MEM_ACCESS_RW);
-
nouveauCreateContextObject(nmesa, Nv3D, nmesa->screen->card->class_3d);
if (nmesa->screen->card->type>=NV_10) {
nouveauCreateContextObject(nmesa, NvCtxSurf2D, NV10_CONTEXT_SURFACES_2D);
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_object.h b/src/mesa/drivers/dri/nouveau/nouveau_object.h
index 0be9b4309c..8c72d014da 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_object.h
+++ b/src/mesa/drivers/dri/nouveau/nouveau_object.h
@@ -14,7 +14,7 @@ enum DMAObjects {
NvMemFormat = 0x80000022,
NvCtxSurf3D = 0x80000023,
NvDmaFB = 0xD0FB0001,
- NvDmaAGP = 0xD0AA0001,
+ NvDmaTT = 0xD0AA0001,
NvSyncNotify = 0xD0000001,
NvQueryNotify = 0xD0000002
};
@@ -31,17 +31,5 @@ extern void nouveauObjectOnSubchannel(nouveauContextPtr nmesa, int subchannel, i
extern GLboolean nouveauCreateContextObject(nouveauContextPtr nmesa,
uint32_t handle, int class);
-extern GLboolean nouveauCreateDmaObject(nouveauContextPtr nmesa,
- uint32_t handle,
- int class,
- uint32_t offset,
- uint32_t size,
- int target,
- int access);
-extern GLboolean nouveauCreateDmaObjectFromMem(nouveauContextPtr nmesa,
- uint32_t handle,
- int class,
- nouveau_mem *mem,
- int access);
#endif
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_query.c b/src/mesa/drivers/dri/nouveau/nouveau_query.c
index de3f5b0378..0154140069 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_query.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_query.c
@@ -68,7 +68,7 @@ nouveauBeginQuery(GLcontext *ctx, GLenum target, struct gl_query_object *q)
nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
nouveau_query_object *nq = (nouveau_query_object *)q;
- nouveau_notifier_reset(nmesa->queryNotifier, nq->notifier_id);
+ nouveau_notifier_reset(ctx, nmesa->queryNotifier, nq->notifier_id);
switch (nmesa->screen->card->type) {
case NV_20:
@@ -105,12 +105,13 @@ nouveauUpdateQuery(GLcontext *ctx, GLenum target, struct gl_query_object *q)
nouveau_query_object *nq = (nouveau_query_object *)q;
int status;
- status = nouveau_notifier_status(nmesa->queryNotifier,
+ status = nouveau_notifier_status(ctx, nmesa->queryNotifier,
nq->notifier_id);
q->Ready = (status == NV_NOTIFY_STATE_STATUS_COMPLETED);
if (q->Ready)
- q->Result = nouveau_notifier_return_val(nmesa->queryNotifier,
+ q->Result = nouveau_notifier_return_val(ctx,
+ nmesa->queryNotifier,
nq->notifier_id);
}
@@ -120,7 +121,7 @@ nouveauWaitQueryResult(GLcontext *ctx, GLenum target, struct gl_query_object *q)
nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
nouveau_query_object *nq = (nouveau_query_object *)q;
- nouveau_notifier_wait_status(nmesa->queryNotifier, nq->notifier_id,
+ nouveau_notifier_wait_status(ctx, nmesa->queryNotifier, nq->notifier_id,
NV_NOTIFY_STATE_STATUS_COMPLETED, 0);
nouveauUpdateQuery(ctx, target, q);
}
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_screen.c b/src/mesa/drivers/dri/nouveau/nouveau_screen.c
index 7a4b9f1cd0..bc7f39b042 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_screen.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_screen.c
@@ -328,7 +328,7 @@ void * __driCreateNewScreen_20050727( __DRInativeDisplay *dpy, int scrn, __DRIsc
static const __DRIversion ddx_expected = { 1, 2, 0 };
static const __DRIversion dri_expected = { 4, 0, 0 };
static const __DRIversion drm_expected = { 0, 0, NOUVEAU_DRM_HEADER_PATCHLEVEL };
-#if NOUVEAU_DRM_HEADER_PATCHLEVEL != 6
+#if NOUVEAU_DRM_HEADER_PATCHLEVEL != 7
#error nouveau_drm.h version doesn't match expected version
#endif
dri_interface = interface;
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_span.c b/src/mesa/drivers/dri/nouveau/nouveau_span.c
index 74dec66afc..6e3f9fadf4 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_span.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_span.c
@@ -37,6 +37,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define HAVE_HW_STENCIL_SPANS 0
#define HAVE_HW_STENCIL_PIXELS 0
+static char *fake_span[1280*1024*4];
+
#define HW_CLIPLOOP() \
do { \
int _nc = nmesa->numClipRects; \
@@ -52,6 +54,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
GLuint height = nrb->mesa.Height; \
GLubyte *map = (GLubyte *)(nrb->map ? nrb->map : nrb->mem->map) + \
(nmesa->drawY * nrb->pitch) + (nmesa->drawX * nrb->cpp); \
+ map = fake_span; \
GLuint p; \
(void) p;
@@ -120,6 +123,6 @@ nouveauSpanSetFunctions(nouveau_renderbuffer *nrb, const GLvisual *vis)
{
if (nrb->mesa._ActualFormat == GL_RGBA8)
nouveauInitPointers_ARGB8888(&nrb->mesa);
- else if (nrb->mesa._ActualFormat == GL_RGB5)
+ else // if (nrb->mesa._ActualFormat == GL_RGB5)
nouveauInitPointers_RGB565(&nrb->mesa);
}
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_state.c b/src/mesa/drivers/dri/nouveau/nouveau_state.c
index e9fd188d73..7cb805902a 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_state.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_state.c
@@ -60,14 +60,14 @@ static void nouveauCalcViewport(GLcontext *ctx)
nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
const GLfloat *v = ctx->Viewport._WindowMap.m;
GLfloat *m = nmesa->viewport.m;
- GLfloat xoffset = nmesa->drawX, yoffset = nmesa->drawY;
+ GLfloat xoffset = nmesa->drawX, yoffset = nmesa->drawY + nmesa->drawH;
nmesa->depth_scale = 1.0 / ctx->DrawBuffer->_DepthMaxF;
m[MAT_SX] = v[MAT_SX];
m[MAT_TX] = v[MAT_TX] + xoffset + SUBPIXEL_X;
m[MAT_SY] = - v[MAT_SY];
- m[MAT_TY] = v[MAT_TY] + yoffset + SUBPIXEL_Y;
+ m[MAT_TY] = (-v[MAT_TY]) + yoffset + SUBPIXEL_Y;
m[MAT_SZ] = v[MAT_SZ] * nmesa->depth_scale;
m[MAT_TZ] = v[MAT_TZ] * nmesa->depth_scale;
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_sync.c b/src/mesa/drivers/dri/nouveau/nouveau_sync.c
index 30e6696269..1d1eeede18 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_sync.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_sync.c
@@ -35,53 +35,51 @@
#include "nouveau_msg.h"
#include "nouveau_sync.h"
-nouveau_notifier *
+#define NOTIFIER(__v) \
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx); \
+ volatile uint32_t *__v = (void*)nmesa->notifier_block + notifier->offset
+
+drm_nouveau_notifier_alloc_t *
nouveau_notifier_new(GLcontext *ctx, GLuint handle, GLuint count)
{
nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
- nouveau_notifier *notifier;
+ drm_nouveau_notifier_alloc_t *notifier;
+ int ret;
#ifdef NOUVEAU_RING_DEBUG
return NULL;
#endif
- notifier = CALLOC_STRUCT(nouveau_notifier_t);
+ notifier = CALLOC_STRUCT(drm_nouveau_notifier_alloc);
if (!notifier)
return NULL;
- notifier->mem = nouveau_mem_alloc(ctx,
- NOUVEAU_MEM_FB | NOUVEAU_MEM_MAPPED,
- count * NV_NOTIFIER_SIZE,
- 0);
- if (!notifier->mem) {
- FREE(notifier);
- return NULL;
- }
-
- if (!nouveauCreateDmaObjectFromMem(nmesa, handle, NV_DMA_IN_MEMORY,
- notifier->mem,
- NOUVEAU_MEM_ACCESS_RW)) {
- nouveau_mem_free(ctx, notifier->mem);
+ notifier->channel = nmesa->fifo.channel;
+ notifier->handle = handle;
+ notifier->count = count;
+ ret = drmCommandWriteRead(nmesa->driFd, DRM_NOUVEAU_NOTIFIER_ALLOC,
+ notifier, sizeof(*notifier));
+ if (ret) {
+ MESSAGE("Failed to create notifier 0x%08x: %d\n", handle, ret);
FREE(notifier);
return NULL;
}
- notifier->handle = handle;
return notifier;
}
void
-nouveau_notifier_destroy(GLcontext *ctx, nouveau_notifier *notifier)
+nouveau_notifier_destroy(GLcontext *ctx, drm_nouveau_notifier_alloc_t *notifier)
{
- /*XXX: free DMA object.. */
- nouveau_mem_free(ctx, notifier->mem);
+ /*XXX: free notifier object.. */
FREE(notifier);
}
void
-nouveau_notifier_reset(nouveau_notifier *notifier, GLuint id)
+nouveau_notifier_reset(GLcontext *ctx, drm_nouveau_notifier_alloc_t *notifier,
+ GLuint id)
{
- volatile GLuint *n = notifier->mem->map + (id * NV_NOTIFIER_SIZE);
+ NOTIFIER(n);
#ifdef NOUVEAU_RING_DEBUG
return;
@@ -95,26 +93,29 @@ nouveau_notifier_reset(nouveau_notifier *notifier, GLuint id)
}
GLuint
-nouveau_notifier_status(nouveau_notifier *notifier, GLuint id)
+nouveau_notifier_status(GLcontext *ctx, drm_nouveau_notifier_alloc_t *notifier,
+ GLuint id)
{
- volatile GLuint *n = notifier->mem->map + (id * NV_NOTIFIER_SIZE);
+ NOTIFIER(n);
return n[NV_NOTIFY_STATE/4] >> NV_NOTIFY_STATE_STATUS_SHIFT;
}
GLuint
-nouveau_notifier_return_val(nouveau_notifier *notifier, GLuint id)
+nouveau_notifier_return_val(GLcontext *ctx,
+ drm_nouveau_notifier_alloc_t *notifier, GLuint id)
{
- volatile GLuint *n = notifier->mem->map + (id * NV_NOTIFIER_SIZE);
+ NOTIFIER(n);
return n[NV_NOTIFY_RETURN_VALUE/4];
}
GLboolean
-nouveau_notifier_wait_status(nouveau_notifier *notifier, GLuint id,
+nouveau_notifier_wait_status(GLcontext *ctx,
+ drm_nouveau_notifier_alloc_t *notifier, GLuint id,
GLuint status, GLuint timeout)
{
- volatile GLuint *n = notifier->mem->map + (id * NV_NOTIFIER_SIZE);
+ NOTIFIER(n);
unsigned int time = 0;
#ifdef NOUVEAU_RING_DEBUG
@@ -144,13 +145,13 @@ nouveau_notifier_wait_status(nouveau_notifier *notifier, GLuint id,
}
void
-nouveau_notifier_wait_nop(GLcontext *ctx, nouveau_notifier *notifier,
- GLuint subc)
+nouveau_notifier_wait_nop(GLcontext *ctx,
+ drm_nouveau_notifier_alloc_t *notifier, GLuint subc)
{
- nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ NOTIFIER(n);
GLboolean ret;
- nouveau_notifier_reset(notifier, 0);
+ nouveau_notifier_reset(ctx, notifier, 0);
BEGIN_RING_SIZE(subc, NV_NOTIFY, 1);
OUT_RING (NV_NOTIFY_STYLE_WRITE_ONLY);
@@ -158,7 +159,7 @@ nouveau_notifier_wait_nop(GLcontext *ctx, nouveau_notifier *notifier,
OUT_RING (0);
FIRE_RING();
- ret = nouveau_notifier_wait_status(notifier, 0,
+ ret = nouveau_notifier_wait_status(ctx, notifier, 0,
NV_NOTIFY_STATE_STATUS_COMPLETED,
0 /* no timeout */);
if (ret == GL_FALSE) MESSAGE("wait on notifier failed\n");
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_sync.h b/src/mesa/drivers/dri/nouveau/nouveau_sync.h
index 019d5f6629..b56cc5fb54 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_sync.h
+++ b/src/mesa/drivers/dri/nouveau/nouveau_sync.h
@@ -47,21 +47,23 @@
#define NV_NOTIFY 0x00000104
#define NV_NOTIFY_STYLE_WRITE_ONLY 0
-typedef struct nouveau_notifier_t {
- GLuint handle;
- nouveau_mem *mem;
-} nouveau_notifier;
-
-extern nouveau_notifier *nouveau_notifier_new(GLcontext *, GLuint handle,
- GLuint count);
-extern void nouveau_notifier_destroy(GLcontext *, nouveau_notifier *);
-extern void nouveau_notifier_reset(nouveau_notifier *, GLuint id);
-extern GLuint nouveau_notifier_status(nouveau_notifier *, GLuint id);
-extern GLuint nouveau_notifier_return_val(nouveau_notifier *, GLuint id);
-extern GLboolean nouveau_notifier_wait_status(nouveau_notifier *r, GLuint id,
- GLuint status, GLuint timeout);
-extern void nouveau_notifier_wait_nop(GLcontext *ctx,
- nouveau_notifier *, GLuint subc);
+extern drm_nouveau_notifier_alloc_t *
+nouveau_notifier_new(GLcontext *, GLuint handle, GLuint count);
+extern void
+nouveau_notifier_destroy(GLcontext *, drm_nouveau_notifier_alloc_t *);
+extern void
+nouveau_notifier_reset(GLcontext *, drm_nouveau_notifier_alloc_t *, GLuint id);
+extern GLuint
+nouveau_notifier_status(GLcontext *, drm_nouveau_notifier_alloc_t *, GLuint id);
+extern GLuint
+nouveau_notifier_return_val(GLcontext *, drm_nouveau_notifier_alloc_t *,
+ GLuint id);
+extern GLboolean
+nouveau_notifier_wait_status(GLcontext *, drm_nouveau_notifier_alloc_t *,
+ GLuint id, GLuint status, GLuint timeout);
+extern void
+nouveau_notifier_wait_nop(GLcontext *ctx, drm_nouveau_notifier_alloc_t *,
+ GLuint subc);
extern GLboolean nouveauSyncInitFuncs(GLcontext *ctx);
#endif
diff --git a/src/mesa/drivers/dri/nouveau/nv10_swtcl.c b/src/mesa/drivers/dri/nouveau/nv10_swtcl.c
index 3bc84d862d..4576c1ede4 100644
--- a/src/mesa/drivers/dri/nouveau/nv10_swtcl.c
+++ b/src/mesa/drivers/dri/nouveau/nv10_swtcl.c
@@ -392,15 +392,6 @@ static inline void nv10OutputVertexFormat(struct nouveau_context* nmesa)
int i;
int slots=0;
int total_size=0;
- /* t_vertex_generic dereferences a NULL pointer if we
- * pass NULL as the vp transform...
- */
- const GLfloat ident_vp[16] = {
- 1.0, 0.0, 0.0, 0.0,
- 0.0, 1.0, 0.0, 0.0,
- 0.0, 0.0, 1.0, 0.0,
- 0.0, 0.0, 0.0, 1.0
- };
nmesa->vertex_attr_count = 0;
RENDERINPUTS_COPY(index, nmesa->render_inputs_bitset);
@@ -431,28 +422,20 @@ static inline void nv10OutputVertexFormat(struct nouveau_context* nmesa)
if (RENDERINPUTS_TEST(index, i))
{
slots=i+1;
- if (i==_TNL_ATTRIB_POS)
- {
- /* special-case POS */
- EMIT_ATTR(_TNL_ATTRIB_POS,EMIT_3F_VIEWPORT);
- }
- else
+ switch(attr_size[i])
{
- switch(attr_size[i])
- {
- case 1:
- EMIT_ATTR(i,EMIT_1F);
- break;
- case 2:
- EMIT_ATTR(i,EMIT_2F);
- break;
- case 3:
- EMIT_ATTR(i,EMIT_3F);
- break;
- case 4:
- EMIT_ATTR(i,EMIT_4F);
- break;
- }
+ case 1:
+ EMIT_ATTR(i,EMIT_1F);
+ break;
+ case 2:
+ EMIT_ATTR(i,EMIT_2F);
+ break;
+ case 3:
+ EMIT_ATTR(i,EMIT_3F);
+ break;
+ case 4:
+ EMIT_ATTR(i,EMIT_4F);
+ break;
}
if (i==_TNL_ATTRIB_COLOR0)
nmesa->color_offset=total_size;
@@ -465,7 +448,7 @@ static inline void nv10OutputVertexFormat(struct nouveau_context* nmesa)
nmesa->vertex_size=_tnl_install_attrs( ctx,
nmesa->vertex_attrs,
nmesa->vertex_attr_count,
- ident_vp, 0 );
+ NULL, 0 );
assert(nmesa->vertex_size==total_size*4);
/*
diff --git a/src/mesa/drivers/dri/nouveau/nv30_state.c b/src/mesa/drivers/dri/nouveau/nv30_state.c
index ad21fa2730..9b010954b3 100644
--- a/src/mesa/drivers/dri/nouveau/nv30_state.c
+++ b/src/mesa/drivers/dri/nouveau/nv30_state.c
@@ -639,25 +639,45 @@ void (*ReadBuffer)( GLcontext *ctx, GLenum buffer );
/** Set rasterization mode */
void (*RenderMode)(GLcontext *ctx, GLenum mode );
+/* Translate GL coords to window coords, clamping w/h to the
+ * dimensions of the window.
+ */
+static void nv30WindowCoords(nouveauContextPtr nmesa,
+ GLuint x, GLuint y, GLuint w, GLuint h,
+ GLuint *wX, GLuint *wY, GLuint *wW, GLuint *wH)
+{
+ if ((x+w) > nmesa->drawW)
+ w = nmesa->drawW - x;
+ (*wX) = x + nmesa->drawX;
+ (*wW) = w;
+
+ if ((y+h) > nmesa->drawH)
+ h = nmesa->drawH - y;
+ (*wY) = (nmesa->drawH - y) - h + nmesa->drawY;
+ (*wH) = h;
+}
+
/** Define the scissor box */
static void nv30Scissor(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h)
{
nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ GLuint wX, wY, wW, wH;
/* There's no scissor enable bit, so adjust the scissor to cover the
* maximum draw buffer bounds
*/
if (!ctx->Scissor.Enabled) {
- x = y = 0;
- w = h = 4095;
+ wX = nmesa->drawX;
+ wY = nmesa->drawY;
+ wW = nmesa->drawW;
+ wH = nmesa->drawH;
} else {
- x += nmesa->drawX;
- y += nmesa->drawY;
+ nv30WindowCoords(nmesa, x, y, w, h, &wX, &wY, &wW, &wH);
}
BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_SCISSOR_WIDTH_XPOS, 2);
- OUT_RING_CACHE(((w) << 16) | x);
- OUT_RING_CACHE(((h) << 16) | y);
+ OUT_RING_CACHE ((wW << 16) | wX);
+ OUT_RING_CACHE ((wH << 16) | wY);
}
/** Select flat or smooth shading */
@@ -751,19 +771,21 @@ static void nv30WindowMoved(nouveauContextPtr nmesa)
{
GLcontext *ctx = nmesa->glCtx;
GLfloat *v = nmesa->viewport.m;
- GLuint w = ctx->Viewport.Width;
- GLuint h = ctx->Viewport.Height;
- GLuint x = ctx->Viewport.X + nmesa->drawX;
- GLuint y = ctx->Viewport.Y + nmesa->drawY;
+ GLuint wX, wY, wW, wH;
+ nv30WindowCoords(nmesa, ctx->Viewport.X, ctx->Viewport.Y,
+ ctx->Viewport.Width, ctx->Viewport.Height,
+ &wX, &wY, &wW, &wH);
BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_VIEWPORT_DIMS_0, 2);
- OUT_RING_CACHE((w << 16) | x);
- OUT_RING_CACHE((h << 16) | y);
+ OUT_RING_CACHE ((wW << 16) | wX);
+ OUT_RING_CACHE ((wH << 16) | wY);
+
/* something to do with clears, possibly doesn't belong here */
BEGIN_RING_CACHE(NvSub3D,
NV30_TCL_PRIMITIVE_3D_VIEWPORT_COLOR_BUFFER_OFS0, 2);
- OUT_RING_CACHE(((w+x) << 16) | x);
- OUT_RING_CACHE(((h+y) << 16) | y);
+ OUT_RING_CACHE(((nmesa->drawX + nmesa->drawW) << 16) | nmesa->drawX);
+ OUT_RING_CACHE(((nmesa->drawY + nmesa->drawH) << 16) | nmesa->drawY);
+
/* viewport transform */
BEGIN_RING_CACHE(NvSub3D, NV30_TCL_PRIMITIVE_3D_VIEWPORT_XFRM_OX, 8);
OUT_RING_CACHEf (v[MAT_TX]);
@@ -786,7 +808,7 @@ static GLboolean nv30InitCard(nouveauContextPtr nmesa)
BEGIN_RING_SIZE(NvSub3D, NV30_TCL_PRIMITIVE_3D_SET_OBJECT1, 3);
OUT_RING(NvDmaFB);
- OUT_RING(NvDmaAGP);
+ OUT_RING(NvDmaTT);
OUT_RING(NvDmaFB);
BEGIN_RING_SIZE(NvSub3D, NV30_TCL_PRIMITIVE_3D_SET_OBJECT8, 1);
OUT_RING(NvDmaFB);
diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h
index 5e07cbd88f..6615bc79fb 100644
--- a/src/mesa/drivers/dri/r300/r300_context.h
+++ b/src/mesa/drivers/dri/r300/r300_context.h
@@ -583,19 +583,6 @@ struct r300_vertex_shader_fragment {
struct r300_vertex_shader_state {
struct r300_vertex_shader_fragment program;
-
- struct r300_vertex_shader_fragment unknown1;
- struct r300_vertex_shader_fragment unknown2;
-
- int program_start;
- int unknown_ptr1; /* pointer within program space */
- int program_end;
-
- int param_offset;
- int param_count;
-
- int unknown_ptr2; /* pointer within program space */
- int unknown_ptr3; /* pointer within program space */
};
extern int hw_tcl_on;
@@ -805,10 +792,6 @@ struct r300_state {
DECLARE_RENDERINPUTS(render_inputs_bitset); /* actual render inputs that R300 was configured for.
They are the same as tnl->render_inputs for fixed pipeline */
- struct {
- int transform_offset; /* Transform matrix offset, -1 if none */
- } vap_param; /* vertex processor parameter allocation - tells where to write parameters */
-
struct r300_stencilbuffer_state stencil;
};
diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h
index 3ce09c16d3..e59919be49 100644
--- a/src/mesa/drivers/dri/r300/r300_reg.h
+++ b/src/mesa/drivers/dri/r300/r300_reg.h
@@ -336,13 +336,15 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
* The meaning of the two UNKNOWN fields is obviously not known. However,
* experiments so far have shown that both *must* point to an instruction
* inside the vertex program, otherwise the GPU locks up.
+ *
* fglrx usually sets CNTL_3_UNKNOWN to the end of the program and
- * CNTL_1_UNKNOWN points to instruction where last write to position takes
- * place.
+ * R300_PVS_CNTL_1_POS_END_SHIFT points to instruction where last write to
+ * position takes place.
+ *
* Most likely this is used to ignore rest of the program in cases
* where group of verts arent visible. For some reason this "section"
* is sometimes accepted other instruction that have no relationship with
- *position calculations.
+ * position calculations.
*/
#define R300_VAP_PVS_CNTL_1 0x22D0
# define R300_PVS_CNTL_1_PROGRAM_START_SHIFT 0
diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c
index a723c3c530..b5cf21d644 100644
--- a/src/mesa/drivers/dri/r300/r300_state.c
+++ b/src/mesa/drivers/dri/r300/r300_state.c
@@ -715,7 +715,7 @@ static void r300LineWidth(GLcontext * ctx, GLfloat widthf)
widthf = ctx->Line._Width;
R300_STATECHANGE(r300, lcntl);
- r300->hw.lcntl.cmd[1] |=
+ r300->hw.lcntl.cmd[1] =
R300_LINE_CNT_HO | R300_LINE_CNT_VE | (int)(widthf * 6.0);
}
@@ -1477,9 +1477,7 @@ static void r300SetupRSUnit(GLcontext * ctx)
if(_nc>_p->vpu.count)_p->vpu.count=_nc;\
}while(0)
-void static inline setup_vertex_shader_fragment(r300ContextPtr r300, int dest, struct
- r300_vertex_shader_fragment
- *vsf)
+static inline void r300SetupVertexProgramFragment(r300ContextPtr r300, int dest, struct r300_vertex_shader_fragment *vsf)
{
int i;
@@ -1487,8 +1485,7 @@ void static inline setup_vertex_shader_fragment(r300ContextPtr r300, int dest, s
return;
if (vsf->length & 0x3) {
- fprintf(stderr,
- "VERTEX_SHADER_FRAGMENT must have length divisible by 4\n");
+ fprintf(stderr, "VERTEX_SHADER_FRAGMENT must have length divisible by 4\n");
_mesa_exit(-1);
}
@@ -1496,147 +1493,100 @@ void static inline setup_vertex_shader_fragment(r300ContextPtr r300, int dest, s
case 0:
R300_STATECHANGE(r300, vpi);
for (i = 0; i < vsf->length; i++)
- r300->hw.vpi.cmd[R300_VPI_INSTR_0 + i +
- 4 * (dest & 0xff)] = (vsf->body.d[i]);
- bump_vpu_count(r300->hw.vpi.cmd,
- vsf->length + 4 * (dest & 0xff));
+ r300->hw.vpi.cmd[R300_VPI_INSTR_0 + i + 4 * (dest & 0xff)] = (vsf->body.d[i]);
+ bump_vpu_count(r300->hw.vpi.cmd, vsf->length + 4 * (dest & 0xff));
break;
case 2:
R300_STATECHANGE(r300, vpp);
for (i = 0; i < vsf->length; i++)
- r300->hw.vpp.cmd[R300_VPP_PARAM_0 + i +
- 4 * (dest & 0xff)] = (vsf->body.d[i]);
- bump_vpu_count(r300->hw.vpp.cmd,
- vsf->length + 4 * (dest & 0xff));
+ r300->hw.vpp.cmd[R300_VPP_PARAM_0 + i + 4 * (dest & 0xff)] = (vsf->body.d[i]);
+ bump_vpu_count(r300->hw.vpp.cmd, vsf->length + 4 * (dest & 0xff));
break;
case 4:
R300_STATECHANGE(r300, vps);
for (i = 0; i < vsf->length; i++)
- r300->hw.vps.cmd[1 + i + 4 * (dest & 0xff)] =
- (vsf->body.d[i]);
- bump_vpu_count(r300->hw.vps.cmd,
- vsf->length + 4 * (dest & 0xff));
+ r300->hw.vps.cmd[1 + i + 4 * (dest & 0xff)] = (vsf->body.d[i]);
+ bump_vpu_count(r300->hw.vps.cmd, vsf->length + 4 * (dest & 0xff));
break;
default:
- fprintf(stderr,
- "%s:%s don't know how to handle dest %04x\n",
- __FILE__, __FUNCTION__, dest);
+ fprintf(stderr, "%s:%s don't know how to handle dest %04x\n", __FILE__, __FUNCTION__, dest);
_mesa_exit(-1);
}
}
-/* just a skeleton for now.. */
-
-/* Generate a vertex shader that simply transforms vertex and texture coordinates,
- while leaving colors intact. Nothing fancy (like lights)
-
- If implementing lights make a copy first, so it is easy to switch between the two versions */
-static void r300GenerateSimpleVertexShader(r300ContextPtr r300)
+static void r300SetupDefaultVertexProgram(r300ContextPtr rmesa)
{
- int i;
+ struct r300_vertex_shader_state *prog = &(rmesa->state.vertex_shader);
GLuint o_reg = 0;
-
- /* Allocate parameters */
- r300->state.vap_param.transform_offset = 0x0; /* transform matrix */
- r300->state.vertex_shader.param_offset = 0x0;
- r300->state.vertex_shader.param_count = 0x4; /* 4 vector values - 4x4 matrix */
-
- r300->state.vertex_shader.program_start = 0x0;
- r300->state.vertex_shader.unknown_ptr1 = 0x4; /* magic value ? */
- r300->state.vertex_shader.program_end = 0x0;
-
- r300->state.vertex_shader.unknown_ptr2 = 0x0; /* magic value */
- r300->state.vertex_shader.unknown_ptr3 = 0x4; /* magic value */
-
- r300->state.vertex_shader.unknown1.length = 0;
- r300->state.vertex_shader.unknown2.length = 0;
-
-#define WRITE_OP(oper,source1,source2,source3) {\
- r300->state.vertex_shader.program.body.i[r300->state.vertex_shader.program_end].op=(oper); \
- r300->state.vertex_shader.program.body.i[r300->state.vertex_shader.program_end].src[0]=(source1); \
- r300->state.vertex_shader.program.body.i[r300->state.vertex_shader.program_end].src[1]=(source2); \
- r300->state.vertex_shader.program.body.i[r300->state.vertex_shader.program_end].src[2]=(source3); \
- r300->state.vertex_shader.program_end++; \
- }
-
- for (i = VERT_ATTRIB_POS; i < VERT_ATTRIB_MAX; i++)
- if (r300->state.sw_tcl_inputs[i] != -1) {
- WRITE_OP(EASY_VSF_OP(MUL, o_reg++, ALL, RESULT),
- VSF_REG(r300->state.sw_tcl_inputs[i]),
- VSF_ATTR_UNITY(r300->state.
- sw_tcl_inputs[i]),
- VSF_UNITY(r300->state.sw_tcl_inputs[i])
- )
-
+ int i;
+ int inst_count = 0;
+ int param_count = 0;
+ int program_end = 0;
+
+ for (i = VERT_ATTRIB_POS; i < VERT_ATTRIB_MAX; i++) {
+ if (rmesa->state.sw_tcl_inputs[i] != -1) {
+ prog->program.body.i[program_end].op = EASY_VSF_OP(MUL, o_reg++, ALL, RESULT);
+ prog->program.body.i[program_end].src[0] = VSF_REG(rmesa->state.sw_tcl_inputs[i]);
+ prog->program.body.i[program_end].src[1] = VSF_ATTR_UNITY(rmesa->state.sw_tcl_inputs[i]);
+ prog->program.body.i[program_end].src[2] = VSF_UNITY(rmesa->state.sw_tcl_inputs[i]);
+ program_end++;
}
+ }
- r300->state.vertex_shader.program_end--; /* r300 wants program length to be one more - no idea why */
- r300->state.vertex_shader.program.length =
- (r300->state.vertex_shader.program_end + 1) * 4;
+ prog->program.length = program_end * 4;
- r300->state.vertex_shader.unknown_ptr1 = r300->state.vertex_shader.program_end; /* magic value ? */
- r300->state.vertex_shader.unknown_ptr2 = r300->state.vertex_shader.program_end; /* magic value ? */
- r300->state.vertex_shader.unknown_ptr3 = r300->state.vertex_shader.program_end; /* magic value ? */
+ r300SetupVertexProgramFragment(rmesa, VSF_DEST_PROGRAM, &(prog->program));
+ inst_count = (prog->program.length / 4) - 1;
+ R300_STATECHANGE(rmesa, pvs);
+ rmesa->hw.pvs.cmd[R300_PVS_CNTL_1] =
+ (0 << R300_PVS_CNTL_1_PROGRAM_START_SHIFT) |
+ (inst_count << R300_PVS_CNTL_1_POS_END_SHIFT) |
+ (inst_count << R300_PVS_CNTL_1_PROGRAM_END_SHIFT);
+ rmesa->hw.pvs.cmd[R300_PVS_CNTL_2] =
+ (0 << R300_PVS_CNTL_2_PARAM_OFFSET_SHIFT) |
+ (param_count << R300_PVS_CNTL_2_PARAM_COUNT_SHIFT);
+ rmesa->hw.pvs.cmd[R300_PVS_CNTL_3] =
+ (inst_count << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT) |
+ (inst_count << R300_PVS_CNTL_3_PROGRAM_UNKNOWN2_SHIFT);
}
-static void r300SetupVertexProgram(r300ContextPtr rmesa)
+static void r300SetupRealVertexProgram(r300ContextPtr rmesa)
{
GLcontext *ctx = rmesa->radeon.glCtx;
- int inst_count;
- int param_count;
- struct r300_vertex_program *prog =
- (struct r300_vertex_program *)CURRENT_VERTEX_SHADER(ctx);
+ struct r300_vertex_program *prog = (struct r300_vertex_program *)CURRENT_VERTEX_SHADER(ctx);
+ int inst_count = 0;
+ int param_count = 0;
- ((drm_r300_cmd_header_t *) rmesa->hw.vpp.cmd)->vpu.count = 0;
+ /* FIXME: r300SetupVertexProgramFragment */
R300_STATECHANGE(rmesa, vpp);
param_count =
- r300VertexProgUpdateParams(ctx, (struct r300_vertex_program_cont *)
- ctx->VertexProgram._Current /*prog */ ,
+ r300VertexProgUpdateParams(ctx,
+ (struct r300_vertex_program_cont *)
+ ctx->VertexProgram._Current,
(float *)&rmesa->hw.vpp.
cmd[R300_VPP_PARAM_0]);
bump_vpu_count(rmesa->hw.vpp.cmd, param_count);
param_count /= 4;
- /* Reset state, in case we don't use something */
- ((drm_r300_cmd_header_t *) rmesa->hw.vpi.cmd)->vpu.count = 0;
- ((drm_r300_cmd_header_t *) rmesa->hw.vps.cmd)->vpu.count = 0;
-
- setup_vertex_shader_fragment(rmesa, VSF_DEST_PROGRAM, &(prog->program));
-
-#if 0
- setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN1,
- &(rmesa->state.vertex_shader.unknown1));
- setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN2,
- &(rmesa->state.vertex_shader.unknown2));
-#endif
-
- inst_count = prog->program.length / 4 - 1;
+ r300SetupVertexProgramFragment(rmesa, VSF_DEST_PROGRAM, &(prog->program));
+ inst_count = (prog->program.length / 4) - 1;
R300_STATECHANGE(rmesa, pvs);
rmesa->hw.pvs.cmd[R300_PVS_CNTL_1] =
- (0 << R300_PVS_CNTL_1_PROGRAM_START_SHIFT)
- | (inst_count /*pos_end */ << R300_PVS_CNTL_1_POS_END_SHIFT)
- | (inst_count << R300_PVS_CNTL_1_PROGRAM_END_SHIFT);
+ (0 << R300_PVS_CNTL_1_PROGRAM_START_SHIFT) |
+ (inst_count << R300_PVS_CNTL_1_POS_END_SHIFT) |
+ (inst_count << R300_PVS_CNTL_1_PROGRAM_END_SHIFT);
rmesa->hw.pvs.cmd[R300_PVS_CNTL_2] =
- (0 << R300_PVS_CNTL_2_PARAM_OFFSET_SHIFT)
- | (param_count << R300_PVS_CNTL_2_PARAM_COUNT_SHIFT);
+ (0 << R300_PVS_CNTL_2_PARAM_OFFSET_SHIFT) |
+ (param_count << R300_PVS_CNTL_2_PARAM_COUNT_SHIFT);
rmesa->hw.pvs.cmd[R300_PVS_CNTL_3] =
- (0 /*rmesa->state.vertex_shader.unknown_ptr2 */ <<
- R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT)
- | (inst_count /*rmesa->state.vertex_shader.unknown_ptr3 */ <<
- 0);
-
- /* This is done for vertex shader fragments, but also needs to be done for vap_pvs,
- so I leave it as a reminder */
-#if 0
- reg_start(R300_VAP_PVS_WAITIDLE, 0);
- e32(0x00000000);
-#endif
+ (inst_count << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT) |
+ (inst_count << R300_PVS_CNTL_3_PROGRAM_UNKNOWN2_SHIFT);
}
-static void r300SetupVertexShader(r300ContextPtr rmesa)
+static void r300SetupVertexProgram(r300ContextPtr rmesa)
{
GLcontext *ctx = rmesa->radeon.glCtx;
@@ -1649,46 +1599,16 @@ static void r300SetupVertexShader(r300ContextPtr rmesa)
0x400 area might have something to do with pixel shaders as it appears right after pfs programming.
0x406 is set to { 0.0, 0.0, 1.0, 0.0 } most of the time but should change with smooth points and in other rare cases. */
//setup_vertex_shader_fragment(rmesa, 0x406, &unk4);
- if (hw_tcl_on
- && ((struct r300_vertex_program *)CURRENT_VERTEX_SHADER(ctx))->
- translated) {
- r300SetupVertexProgram(rmesa);
- return;
+ if (hw_tcl_on && ((struct r300_vertex_program *)CURRENT_VERTEX_SHADER(ctx))->translated) {
+ r300SetupRealVertexProgram(rmesa);
+ } else {
+ /* FIXME: This needs to be replaced by vertex shader generation code. */
+ r300SetupDefaultVertexProgram(rmesa);
}
- /* This needs to be replaced by vertex shader generation code */
- r300GenerateSimpleVertexShader(rmesa);
-
- setup_vertex_shader_fragment(rmesa, VSF_DEST_PROGRAM,
- &(rmesa->state.vertex_shader.program));
-
-#if 0
- setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN1,
- &(rmesa->state.vertex_shader.unknown1));
- setup_vertex_shader_fragment(rmesa, VSF_DEST_UNKNOWN2,
- &(rmesa->state.vertex_shader.unknown2));
-#endif
-
- R300_STATECHANGE(rmesa, pvs);
- rmesa->hw.pvs.cmd[R300_PVS_CNTL_1] =
- (rmesa->state.vertex_shader.
- program_start << R300_PVS_CNTL_1_PROGRAM_START_SHIFT)
- | (rmesa->state.vertex_shader.
- unknown_ptr1 << R300_PVS_CNTL_1_POS_END_SHIFT)
- | (rmesa->state.vertex_shader.
- program_end << R300_PVS_CNTL_1_PROGRAM_END_SHIFT);
- rmesa->hw.pvs.cmd[R300_PVS_CNTL_2] =
- (rmesa->state.vertex_shader.
- param_offset << R300_PVS_CNTL_2_PARAM_OFFSET_SHIFT)
- | (rmesa->state.vertex_shader.
- param_count << R300_PVS_CNTL_2_PARAM_COUNT_SHIFT);
- rmesa->hw.pvs.cmd[R300_PVS_CNTL_3] =
- (rmesa->state.vertex_shader.
- unknown_ptr2 << R300_PVS_CNTL_3_PROGRAM_UNKNOWN_SHIFT)
- | (rmesa->state.vertex_shader.unknown_ptr3 << 0);
- /* This is done for vertex shader fragments, but also needs to be done for vap_pvs,
- so I leave it as a reminder */
+ /* FIXME: This is done for vertex shader fragments, but also needs to be
+ * done for vap_pvs, so I leave it as a reminder. */
#if 0
reg_start(R300_VAP_PVS_WAITIDLE, 0);
e32(0x00000000);
@@ -1941,6 +1861,8 @@ static void r300ResetHwState(r300ContextPtr r300)
r300PolygonOffset(ctx, ctx->Polygon.OffsetFactor,
ctx->Polygon.OffsetUnits);
+ r300Enable(ctx, GL_POLYGON_OFFSET_POINT, ctx->Polygon.OffsetPoint);
+ r300Enable(ctx, GL_POLYGON_OFFSET_LINE, ctx->Polygon.OffsetLine);
r300Enable(ctx, GL_POLYGON_OFFSET_FILL, ctx->Polygon.OffsetFill);
r300->hw.unk42C0.cmd[1] = 0x4B7FFFFF;
@@ -2094,7 +2016,6 @@ void r300UpdateShaders(r300ContextPtr rmesa)
}
r300UpdateStateParameters(ctx, _NEW_PROGRAM);
}
-
}
static void r300SetupPixelShader(r300ContextPtr rmesa)
@@ -2113,62 +2034,61 @@ static void r300SetupPixelShader(r300ContextPtr rmesa)
__FUNCTION__);
return;
}
-#define OUTPUT_FIELD(st, reg, field) \
- R300_STATECHANGE(rmesa, st); \
- for(i=0;i<=fp->alu_end;i++) \
- rmesa->hw.st.cmd[R300_FPI_INSTR_0+i]=fp->alu.inst[i].field;\
- rmesa->hw.st.cmd[R300_FPI_CMD_0]=cmdpacket0(reg, fp->alu_end+1);
-
- OUTPUT_FIELD(fpi[0], R300_PFS_INSTR0_0, inst0);
- OUTPUT_FIELD(fpi[1], R300_PFS_INSTR1_0, inst1);
- OUTPUT_FIELD(fpi[2], R300_PFS_INSTR2_0, inst2);
- OUTPUT_FIELD(fpi[3], R300_PFS_INSTR3_0, inst3);
-#undef OUTPUT_FIELD
+
+ R300_STATECHANGE(rmesa, fpi[0]);
+ rmesa->hw.fpi[0].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR0_0, fp->alu_end + 1);
+ for (i = 0; i <= fp->alu_end; i++) {
+ rmesa->hw.fpi[0].cmd[R300_FPI_INSTR_0 + i] = fp->alu.inst[i].inst0;
+ }
+
+ R300_STATECHANGE(rmesa, fpi[1]);
+ rmesa->hw.fpi[1].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR1_0, fp->alu_end + 1);
+ for (i = 0; i <= fp->alu_end; i++) {
+ rmesa->hw.fpi[1].cmd[R300_FPI_INSTR_0 + i] = fp->alu.inst[i].inst1;
+ }
+
+ R300_STATECHANGE(rmesa, fpi[2]);
+ rmesa->hw.fpi[2].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR2_0, fp->alu_end + 1);
+ for (i = 0; i <= fp->alu_end; i++) {
+ rmesa->hw.fpi[2].cmd[R300_FPI_INSTR_0 + i] = fp->alu.inst[i].inst2;
+ }
+
+ R300_STATECHANGE(rmesa, fpi[3]);
+ rmesa->hw.fpi[3].cmd[R300_FPI_CMD_0] = cmdpacket0(R300_PFS_INSTR3_0, fp->alu_end + 1);
+ for (i = 0; i <= fp->alu_end; i++) {
+ rmesa->hw.fpi[3].cmd[R300_FPI_INSTR_0 + i] = fp->alu.inst[i].inst3;
+ }
R300_STATECHANGE(rmesa, fp);
+ rmesa->hw.fp.cmd[R300_FP_CNTL0] = fp->cur_node | (fp->first_node_has_tex << 3);
+ rmesa->hw.fp.cmd[R300_FP_CNTL1] = fp->max_temp_idx;
+ rmesa->hw.fp.cmd[R300_FP_CNTL2] =
+ (fp->alu_offset << R300_PFS_CNTL_ALU_OFFSET_SHIFT) |
+ (fp->alu_end << R300_PFS_CNTL_ALU_END_SHIFT) |
+ (fp->tex_offset << R300_PFS_CNTL_TEX_OFFSET_SHIFT) |
+ (fp->tex_end << R300_PFS_CNTL_TEX_END_SHIFT);
/* I just want to say, the way these nodes are stored.. weird.. */
for (i = 0, k = (4 - (fp->cur_node + 1)); i < 4; i++, k++) {
if (i < (fp->cur_node + 1)) {
rmesa->hw.fp.cmd[R300_FP_NODE0 + k] =
- (fp->node[i].
- alu_offset << R300_PFS_NODE_ALU_OFFSET_SHIFT)
- | (fp->node[i].
- alu_end << R300_PFS_NODE_ALU_END_SHIFT)
- | (fp->node[i].
- tex_offset << R300_PFS_NODE_TEX_OFFSET_SHIFT)
- | (fp->node[i].
- tex_end << R300_PFS_NODE_TEX_END_SHIFT)
- | fp->node[i].flags;
+ (fp->node[i].alu_offset << R300_PFS_NODE_ALU_OFFSET_SHIFT) |
+ (fp->node[i].alu_end << R300_PFS_NODE_ALU_END_SHIFT) |
+ (fp->node[i].tex_offset << R300_PFS_NODE_TEX_OFFSET_SHIFT) |
+ (fp->node[i].tex_end << R300_PFS_NODE_TEX_END_SHIFT) |
+ fp->node[i].flags;
} else {
rmesa->hw.fp.cmd[R300_FP_NODE0 + (3 - i)] = 0;
}
}
- /* PFS_CNTL_0 */
- rmesa->hw.fp.cmd[R300_FP_CNTL0] =
- fp->cur_node | (fp->first_node_has_tex << 3);
- /* PFS_CNTL_1 */
- rmesa->hw.fp.cmd[R300_FP_CNTL1] = fp->max_temp_idx;
- /* PFS_CNTL_2 */
- rmesa->hw.fp.cmd[R300_FP_CNTL2] =
- (fp->alu_offset << R300_PFS_CNTL_ALU_OFFSET_SHIFT)
- | (fp->alu_end << R300_PFS_CNTL_ALU_END_SHIFT)
- | (fp->tex_offset << R300_PFS_CNTL_TEX_OFFSET_SHIFT)
- | (fp->tex_end << R300_PFS_CNTL_TEX_END_SHIFT);
-
R300_STATECHANGE(rmesa, fpp);
+ rmesa->hw.fpp.cmd[R300_FPP_CMD_0] = cmdpacket0(R300_PFS_PARAM_0_X, fp->const_nr * 4);
for (i = 0; i < fp->const_nr; i++) {
- rmesa->hw.fpp.cmd[R300_FPP_PARAM_0 + 4 * i + 0] =
- r300PackFloat24(fp->constant[i][0]);
- rmesa->hw.fpp.cmd[R300_FPP_PARAM_0 + 4 * i + 1] =
- r300PackFloat24(fp->constant[i][1]);
- rmesa->hw.fpp.cmd[R300_FPP_PARAM_0 + 4 * i + 2] =
- r300PackFloat24(fp->constant[i][2]);
- rmesa->hw.fpp.cmd[R300_FPP_PARAM_0 + 4 * i + 3] =
- r300PackFloat24(fp->constant[i][3]);
+ rmesa->hw.fpp.cmd[R300_FPP_PARAM_0 + 4 * i + 0] = r300PackFloat24(fp->constant[i][0]);
+ rmesa->hw.fpp.cmd[R300_FPP_PARAM_0 + 4 * i + 1] = r300PackFloat24(fp->constant[i][1]);
+ rmesa->hw.fpp.cmd[R300_FPP_PARAM_0 + 4 * i + 2] = r300PackFloat24(fp->constant[i][2]);
+ rmesa->hw.fpp.cmd[R300_FPP_PARAM_0 + 4 * i + 3] = r300PackFloat24(fp->constant[i][3]);
}
- rmesa->hw.fpp.cmd[R300_FPP_CMD_0] =
- cmdpacket0(R300_PFS_PARAM_0_X, fp->const_nr * 4);
}
void r300UpdateShaderStates(r300ContextPtr rmesa)
@@ -2182,7 +2102,7 @@ void r300UpdateShaderStates(r300ContextPtr rmesa)
r300SetupTextures(ctx);
if ((rmesa->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL))
- r300SetupVertexShader(rmesa);
+ r300SetupVertexProgram(rmesa);
r300SetupRSUnit(ctx);
}
diff --git a/src/mesa/drivers/dri/r300/radeon_lock.h b/src/mesa/drivers/dri/r300/radeon_lock.h
index c47adc9575..a344837f47 100644
--- a/src/mesa/drivers/dri/r300/radeon_lock.h
+++ b/src/mesa/drivers/dri/r300/radeon_lock.h
@@ -42,9 +42,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef __RADEON_LOCK_H__
#define __RADEON_LOCK_H__
-#if 0
-#include "r200_ioctl.h"
-#endif
#include "radeon_context.h"
extern void radeonGetLock(radeonContextPtr rmesa, GLuint flags);
diff --git a/src/mesa/drivers/windows/gdi/wgl.c b/src/mesa/drivers/windows/gdi/wgl.c
index 197de0743c..49b4ddbd1f 100644
--- a/src/mesa/drivers/windows/gdi/wgl.c
+++ b/src/mesa/drivers/windows/gdi/wgl.c
@@ -32,8 +32,14 @@
/* We're essentially building part of GDI here, so define this so that
* we get the right export linkage. */
+#ifdef __MINGW32__
+#include <GL/gl.h>
+#include <stdlib.h>
+#else
#define _GDI32_
+#endif
#include <windows.h>
+
#include "glapi.h"
#include "GL/wmesa.h" /* protos for wmesa* functions */
diff --git a/src/mesa/drivers/windows/gdi/wmesa.c b/src/mesa/drivers/windows/gdi/wmesa.c
index c5cd2c615b..2eec188912 100644
--- a/src/mesa/drivers/windows/gdi/wmesa.c
+++ b/src/mesa/drivers/windows/gdi/wmesa.c
@@ -1404,70 +1404,70 @@ void WMesaSwapBuffers( HDC hdc )
* table entries. Hopefully, I'll find a better solution. The
* dispatch table generation scripts ought to be making these dummy
* stubs as well. */
-void gl_dispatch_stub_543(void){};
-void gl_dispatch_stub_544(void){};
-void gl_dispatch_stub_545(void){};
-void gl_dispatch_stub_546(void){};
-void gl_dispatch_stub_547(void){};
-void gl_dispatch_stub_548(void){};
-void gl_dispatch_stub_549(void){};
-void gl_dispatch_stub_550(void){};
-void gl_dispatch_stub_551(void){};
-void gl_dispatch_stub_552(void){};
-void gl_dispatch_stub_553(void){};
-void gl_dispatch_stub_554(void){};
-void gl_dispatch_stub_555(void){};
-void gl_dispatch_stub_556(void){};
-void gl_dispatch_stub_557(void){};
-void gl_dispatch_stub_558(void){};
-void gl_dispatch_stub_559(void){};
-void gl_dispatch_stub_560(void){};
-void gl_dispatch_stub_561(void){};
-void gl_dispatch_stub_565(void){};
-void gl_dispatch_stub_566(void){};
-void gl_dispatch_stub_577(void){};
-void gl_dispatch_stub_578(void){};
-void gl_dispatch_stub_603(void){};
-void gl_dispatch_stub_645(void){};
-void gl_dispatch_stub_646(void){};
-void gl_dispatch_stub_647(void){};
-void gl_dispatch_stub_648(void){};
-void gl_dispatch_stub_649(void){};
-void gl_dispatch_stub_650(void){};
-void gl_dispatch_stub_651(void){};
-void gl_dispatch_stub_652(void){};
-void gl_dispatch_stub_653(void){};
-void gl_dispatch_stub_734(void){};
-void gl_dispatch_stub_735(void){};
-void gl_dispatch_stub_736(void){};
-void gl_dispatch_stub_737(void){};
-void gl_dispatch_stub_738(void){};
-void gl_dispatch_stub_745(void){};
-void gl_dispatch_stub_746(void){};
-void gl_dispatch_stub_760(void){};
-void gl_dispatch_stub_761(void){};
-void gl_dispatch_stub_766(void){};
-void gl_dispatch_stub_767(void){};
-void gl_dispatch_stub_768(void){};
-
-void gl_dispatch_stub_562(void){};
-void gl_dispatch_stub_563(void){};
-void gl_dispatch_stub_564(void){};
-void gl_dispatch_stub_567(void){};
-void gl_dispatch_stub_568(void){};
-void gl_dispatch_stub_569(void){};
-void gl_dispatch_stub_580(void){};
-void gl_dispatch_stub_581(void){};
-void gl_dispatch_stub_606(void){};
-void gl_dispatch_stub_654(void){};
-void gl_dispatch_stub_655(void){};
-void gl_dispatch_stub_656(void){};
-void gl_dispatch_stub_739(void){};
-void gl_dispatch_stub_740(void){};
-void gl_dispatch_stub_741(void){};
-void gl_dispatch_stub_748(void){};
-void gl_dispatch_stub_749(void){};
-void gl_dispatch_stub_769(void){};
-void gl_dispatch_stub_770(void){};
-void gl_dispatch_stub_771(void){};
+void gl_dispatch_stub_543(void){}
+void gl_dispatch_stub_544(void){}
+void gl_dispatch_stub_545(void){}
+void gl_dispatch_stub_546(void){}
+void gl_dispatch_stub_547(void){}
+void gl_dispatch_stub_548(void){}
+void gl_dispatch_stub_549(void){}
+void gl_dispatch_stub_550(void){}
+void gl_dispatch_stub_551(void){}
+void gl_dispatch_stub_552(void){}
+void gl_dispatch_stub_553(void){}
+void gl_dispatch_stub_554(void){}
+void gl_dispatch_stub_555(void){}
+void gl_dispatch_stub_556(void){}
+void gl_dispatch_stub_557(void){}
+void gl_dispatch_stub_558(void){}
+void gl_dispatch_stub_559(void){}
+void gl_dispatch_stub_560(void){}
+void gl_dispatch_stub_561(void){}
+void gl_dispatch_stub_565(void){}
+void gl_dispatch_stub_566(void){}
+void gl_dispatch_stub_577(void){}
+void gl_dispatch_stub_578(void){}
+void gl_dispatch_stub_603(void){}
+void gl_dispatch_stub_645(void){}
+void gl_dispatch_stub_646(void){}
+void gl_dispatch_stub_647(void){}
+void gl_dispatch_stub_648(void){}
+void gl_dispatch_stub_649(void){}
+void gl_dispatch_stub_650(void){}
+void gl_dispatch_stub_651(void){}
+void gl_dispatch_stub_652(void){}
+void gl_dispatch_stub_653(void){}
+void gl_dispatch_stub_734(void){}
+void gl_dispatch_stub_735(void){}
+void gl_dispatch_stub_736(void){}
+void gl_dispatch_stub_737(void){}
+void gl_dispatch_stub_738(void){}
+void gl_dispatch_stub_745(void){}
+void gl_dispatch_stub_746(void){}
+void gl_dispatch_stub_760(void){}
+void gl_dispatch_stub_761(void){}
+void gl_dispatch_stub_766(void){}
+void gl_dispatch_stub_767(void){}
+void gl_dispatch_stub_768(void){}
+
+void gl_dispatch_stub_562(void){}
+void gl_dispatch_stub_563(void){}
+void gl_dispatch_stub_564(void){}
+void gl_dispatch_stub_567(void){}
+void gl_dispatch_stub_568(void){}
+void gl_dispatch_stub_569(void){}
+void gl_dispatch_stub_580(void){}
+void gl_dispatch_stub_581(void){}
+void gl_dispatch_stub_606(void){}
+void gl_dispatch_stub_654(void){}
+void gl_dispatch_stub_655(void){}
+void gl_dispatch_stub_656(void){}
+void gl_dispatch_stub_739(void){}
+void gl_dispatch_stub_740(void){}
+void gl_dispatch_stub_741(void){}
+void gl_dispatch_stub_748(void){}
+void gl_dispatch_stub_749(void){}
+void gl_dispatch_stub_769(void){}
+void gl_dispatch_stub_770(void){}
+void gl_dispatch_stub_771(void){}
diff --git a/src/mesa/glapi/gl_API.xml b/src/mesa/glapi/gl_API.xml
index c7b48c45b5..4bd3b2f0fb 100644
--- a/src/mesa/glapi/gl_API.xml
+++ b/src/mesa/glapi/gl_API.xml
@@ -5605,7 +5605,10 @@
<param name="index" type="GLuint"/>
<param name="v" type="const GLushort *"/>
</function>
-
+ <function name="VertexAttrib4bv" alias="VertexAttrib4bvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLbyte *" count="4"/>
+ </function>
<function name="VertexAttrib4d" alias="VertexAttrib4dARB">
<param name="index" type="GLuint"/>
<param name="x" type="GLdouble"/>
@@ -5628,6 +5631,10 @@
<param name="index" type="GLuint"/>
<param name="v" type="const GLfloat *"/>
</function>
+ <function name="VertexAttrib4iv" alias="VertexAttrib4ivARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLint *" count="4"/>
+ </function>
<function name="VertexAttrib4s" alias="VertexAttrib4sARB">
<param name="index" type="GLuint"/>
<param name="x" type="GLshort"/>
@@ -5639,6 +5646,18 @@
<param name="index" type="GLuint"/>
<param name="v" type="const GLshort *"/>
</function>
+ <function name="VertexAttrib4ubv" alias="VertexAttrib4ubvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLubyte *" count="4"/>
+ </function>
+ <function name="VertexAttrib4uiv" alias="VertexAttrib4uivARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLuint *" count="4"/>
+ </function>
+ <function name="VertexAttrib4usv" alias="VertexAttrib4usvARB">
+ <param name="index" type="GLuint"/>
+ <param name="v" type="const GLushort *" count="4"/>
+ </function>
<function name="VertexAttribPointer" alias="VertexAttribPointerARB">
<param name="index" type="GLuint"/>
diff --git a/src/mesa/glapi/glapitemp.h b/src/mesa/glapi/glapitemp.h
index 2a2fe2a35d..10af9b3085 100644
--- a/src/mesa/glapi/glapitemp.h
+++ b/src/mesa/glapi/glapitemp.h
@@ -3284,6 +3284,11 @@ KEYWORD1 void KEYWORD2 NAME(VertexAttrib4NusvARB)(GLuint index, const GLushort *
DISPATCH(VertexAttrib4NusvARB, (index, v), (F, "glVertexAttrib4NusvARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4bv)(GLuint index, const GLbyte * v)
+{
+ DISPATCH(VertexAttrib4bvARB, (index, v), (F, "glVertexAttrib4bv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib4bvARB)(GLuint index, const GLbyte * v)
{
DISPATCH(VertexAttrib4bvARB, (index, v), (F, "glVertexAttrib4bvARB(%d, %p);\n", index, (const void *) v));
@@ -3329,6 +3334,11 @@ KEYWORD1 void KEYWORD2 NAME(VertexAttrib4fvARB)(GLuint index, const GLfloat * v)
DISPATCH(VertexAttrib4fvARB, (index, v), (F, "glVertexAttrib4fvARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4iv)(GLuint index, const GLint * v)
+{
+ DISPATCH(VertexAttrib4ivARB, (index, v), (F, "glVertexAttrib4iv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ivARB)(GLuint index, const GLint * v)
{
DISPATCH(VertexAttrib4ivARB, (index, v), (F, "glVertexAttrib4ivARB(%d, %p);\n", index, (const void *) v));
@@ -3354,16 +3364,31 @@ KEYWORD1 void KEYWORD2 NAME(VertexAttrib4svARB)(GLuint index, const GLshort * v)
DISPATCH(VertexAttrib4svARB, (index, v), (F, "glVertexAttrib4svARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ubv)(GLuint index, const GLubyte * v)
+{
+ DISPATCH(VertexAttrib4ubvARB, (index, v), (F, "glVertexAttrib4ubv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib4ubvARB)(GLuint index, const GLubyte * v)
{
DISPATCH(VertexAttrib4ubvARB, (index, v), (F, "glVertexAttrib4ubvARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4uiv)(GLuint index, const GLuint * v)
+{
+ DISPATCH(VertexAttrib4uivARB, (index, v), (F, "glVertexAttrib4uiv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib4uivARB)(GLuint index, const GLuint * v)
{
DISPATCH(VertexAttrib4uivARB, (index, v), (F, "glVertexAttrib4uivARB(%d, %p);\n", index, (const void *) v));
}
+KEYWORD1 void KEYWORD2 NAME(VertexAttrib4usv)(GLuint index, const GLushort * v)
+{
+ DISPATCH(VertexAttrib4usvARB, (index, v), (F, "glVertexAttrib4usv(%d, %p);\n", index, (const void *) v));
+}
+
KEYWORD1 void KEYWORD2 NAME(VertexAttrib4usvARB)(GLuint index, const GLushort * v)
{
DISPATCH(VertexAttrib4usvARB, (index, v), (F, "glVertexAttrib4usvARB(%d, %p);\n", index, (const void *) v));
@@ -6464,12 +6489,17 @@ static _glapi_proc UNUSED_TABLE_NAME[] = {
TABLE_ENTRY(VertexAttrib4Nubv),
TABLE_ENTRY(VertexAttrib4Nuiv),
TABLE_ENTRY(VertexAttrib4Nusv),
+ TABLE_ENTRY(VertexAttrib4bv),
TABLE_ENTRY(VertexAttrib4d),
TABLE_ENTRY(VertexAttrib4dv),
TABLE_ENTRY(VertexAttrib4f),
TABLE_ENTRY(VertexAttrib4fv),
+ TABLE_ENTRY(VertexAttrib4iv),
TABLE_ENTRY(VertexAttrib4s),
TABLE_ENTRY(VertexAttrib4sv),
+ TABLE_ENTRY(VertexAttrib4ubv),
+ TABLE_ENTRY(VertexAttrib4uiv),
+ TABLE_ENTRY(VertexAttrib4usv),
TABLE_ENTRY(VertexAttribPointer),
TABLE_ENTRY(BindBuffer),
TABLE_ENTRY(BufferData),
diff --git a/src/mesa/glapi/glprocs.h b/src/mesa/glapi/glprocs.h
index b6651a6bf4..c461333c51 100644
--- a/src/mesa/glapi/glprocs.h
+++ b/src/mesa/glapi/glprocs.h
@@ -958,12 +958,17 @@ static const char gl_string_table[] =
"glVertexAttrib4Nubv\0"
"glVertexAttrib4Nuiv\0"
"glVertexAttrib4Nusv\0"
+ "glVertexAttrib4bv\0"
"glVertexAttrib4d\0"
"glVertexAttrib4dv\0"
"glVertexAttrib4f\0"
"glVertexAttrib4fv\0"
+ "glVertexAttrib4iv\0"
"glVertexAttrib4s\0"
"glVertexAttrib4sv\0"
+ "glVertexAttrib4ubv\0"
+ "glVertexAttrib4uiv\0"
+ "glVertexAttrib4usv\0"
"glVertexAttribPointer\0"
"glBindBuffer\0"
"glBufferData\0"
@@ -2102,142 +2107,147 @@ static const glprocs_table_t static_functions[] = {
NAME_FUNC_OFFSET(16297, glVertexAttrib4NubvARB, glVertexAttrib4NubvARB, NULL, _gloffset_VertexAttrib4NubvARB),
NAME_FUNC_OFFSET(16317, glVertexAttrib4NuivARB, glVertexAttrib4NuivARB, NULL, _gloffset_VertexAttrib4NuivARB),
NAME_FUNC_OFFSET(16337, glVertexAttrib4NusvARB, glVertexAttrib4NusvARB, NULL, _gloffset_VertexAttrib4NusvARB),
- NAME_FUNC_OFFSET(16357, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, _gloffset_VertexAttrib4dARB),
- NAME_FUNC_OFFSET(16374, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, _gloffset_VertexAttrib4dvARB),
- NAME_FUNC_OFFSET(16392, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, _gloffset_VertexAttrib4fARB),
- NAME_FUNC_OFFSET(16409, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, _gloffset_VertexAttrib4fvARB),
- NAME_FUNC_OFFSET(16427, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, _gloffset_VertexAttrib4sARB),
- NAME_FUNC_OFFSET(16444, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, _gloffset_VertexAttrib4svARB),
- NAME_FUNC_OFFSET(16462, glVertexAttribPointerARB, glVertexAttribPointerARB, NULL, _gloffset_VertexAttribPointerARB),
- NAME_FUNC_OFFSET(16484, glBindBufferARB, glBindBufferARB, NULL, _gloffset_BindBufferARB),
- NAME_FUNC_OFFSET(16497, glBufferDataARB, glBufferDataARB, NULL, _gloffset_BufferDataARB),
- NAME_FUNC_OFFSET(16510, glBufferSubDataARB, glBufferSubDataARB, NULL, _gloffset_BufferSubDataARB),
- NAME_FUNC_OFFSET(16526, glDeleteBuffersARB, glDeleteBuffersARB, NULL, _gloffset_DeleteBuffersARB),
- NAME_FUNC_OFFSET(16542, glGenBuffersARB, glGenBuffersARB, NULL, _gloffset_GenBuffersARB),
- NAME_FUNC_OFFSET(16555, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, _gloffset_GetBufferParameterivARB),
- NAME_FUNC_OFFSET(16578, glGetBufferPointervARB, glGetBufferPointervARB, NULL, _gloffset_GetBufferPointervARB),
- NAME_FUNC_OFFSET(16598, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, _gloffset_GetBufferSubDataARB),
- NAME_FUNC_OFFSET(16617, glIsBufferARB, glIsBufferARB, NULL, _gloffset_IsBufferARB),
- NAME_FUNC_OFFSET(16628, glMapBufferARB, glMapBufferARB, NULL, _gloffset_MapBufferARB),
- NAME_FUNC_OFFSET(16640, glUnmapBufferARB, glUnmapBufferARB, NULL, _gloffset_UnmapBufferARB),
- NAME_FUNC_OFFSET(16654, glBeginQueryARB, glBeginQueryARB, NULL, _gloffset_BeginQueryARB),
- NAME_FUNC_OFFSET(16667, glDeleteQueriesARB, glDeleteQueriesARB, NULL, _gloffset_DeleteQueriesARB),
- NAME_FUNC_OFFSET(16683, glEndQueryARB, glEndQueryARB, NULL, _gloffset_EndQueryARB),
- NAME_FUNC_OFFSET(16694, glGenQueriesARB, glGenQueriesARB, NULL, _gloffset_GenQueriesARB),
- NAME_FUNC_OFFSET(16707, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, _gloffset_GetQueryObjectivARB),
- NAME_FUNC_OFFSET(16726, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, _gloffset_GetQueryObjectuivARB),
- NAME_FUNC_OFFSET(16746, glGetQueryivARB, glGetQueryivARB, NULL, _gloffset_GetQueryivARB),
- NAME_FUNC_OFFSET(16759, glIsQueryARB, glIsQueryARB, NULL, _gloffset_IsQueryARB),
- NAME_FUNC_OFFSET(16769, glCompileShaderARB, glCompileShaderARB, NULL, _gloffset_CompileShaderARB),
- NAME_FUNC_OFFSET(16785, glGetActiveUniformARB, glGetActiveUniformARB, NULL, _gloffset_GetActiveUniformARB),
- NAME_FUNC_OFFSET(16804, glGetShaderSourceARB, glGetShaderSourceARB, NULL, _gloffset_GetShaderSourceARB),
- NAME_FUNC_OFFSET(16822, glGetUniformLocationARB, glGetUniformLocationARB, NULL, _gloffset_GetUniformLocationARB),
- NAME_FUNC_OFFSET(16843, glGetUniformfvARB, glGetUniformfvARB, NULL, _gloffset_GetUniformfvARB),
- NAME_FUNC_OFFSET(16858, glGetUniformivARB, glGetUniformivARB, NULL, _gloffset_GetUniformivARB),
- NAME_FUNC_OFFSET(16873, glLinkProgramARB, glLinkProgramARB, NULL, _gloffset_LinkProgramARB),
- NAME_FUNC_OFFSET(16887, glShaderSourceARB, glShaderSourceARB, NULL, _gloffset_ShaderSourceARB),
- NAME_FUNC_OFFSET(16902, glUniform1fARB, glUniform1fARB, NULL, _gloffset_Uniform1fARB),
- NAME_FUNC_OFFSET(16914, glUniform1fvARB, glUniform1fvARB, NULL, _gloffset_Uniform1fvARB),
- NAME_FUNC_OFFSET(16927, glUniform1iARB, glUniform1iARB, NULL, _gloffset_Uniform1iARB),
- NAME_FUNC_OFFSET(16939, glUniform1ivARB, glUniform1ivARB, NULL, _gloffset_Uniform1ivARB),
- NAME_FUNC_OFFSET(16952, glUniform2fARB, glUniform2fARB, NULL, _gloffset_Uniform2fARB),
- NAME_FUNC_OFFSET(16964, glUniform2fvARB, glUniform2fvARB, NULL, _gloffset_Uniform2fvARB),
- NAME_FUNC_OFFSET(16977, glUniform2iARB, glUniform2iARB, NULL, _gloffset_Uniform2iARB),
- NAME_FUNC_OFFSET(16989, glUniform2ivARB, glUniform2ivARB, NULL, _gloffset_Uniform2ivARB),
- NAME_FUNC_OFFSET(17002, glUniform3fARB, glUniform3fARB, NULL, _gloffset_Uniform3fARB),
- NAME_FUNC_OFFSET(17014, glUniform3fvARB, glUniform3fvARB, NULL, _gloffset_Uniform3fvARB),
- NAME_FUNC_OFFSET(17027, glUniform3iARB, glUniform3iARB, NULL, _gloffset_Uniform3iARB),
- NAME_FUNC_OFFSET(17039, glUniform3ivARB, glUniform3ivARB, NULL, _gloffset_Uniform3ivARB),
- NAME_FUNC_OFFSET(17052, glUniform4fARB, glUniform4fARB, NULL, _gloffset_Uniform4fARB),
- NAME_FUNC_OFFSET(17064, glUniform4fvARB, glUniform4fvARB, NULL, _gloffset_Uniform4fvARB),
- NAME_FUNC_OFFSET(17077, glUniform4iARB, glUniform4iARB, NULL, _gloffset_Uniform4iARB),
- NAME_FUNC_OFFSET(17089, glUniform4ivARB, glUniform4ivARB, NULL, _gloffset_Uniform4ivARB),
- NAME_FUNC_OFFSET(17102, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, _gloffset_UniformMatrix2fvARB),
- NAME_FUNC_OFFSET(17121, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, _gloffset_UniformMatrix3fvARB),
- NAME_FUNC_OFFSET(17140, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, _gloffset_UniformMatrix4fvARB),
- NAME_FUNC_OFFSET(17159, glUseProgramObjectARB, glUseProgramObjectARB, NULL, _gloffset_UseProgramObjectARB),
- NAME_FUNC_OFFSET(17172, glValidateProgramARB, glValidateProgramARB, NULL, _gloffset_ValidateProgramARB),
- NAME_FUNC_OFFSET(17190, glBindAttribLocationARB, glBindAttribLocationARB, NULL, _gloffset_BindAttribLocationARB),
- NAME_FUNC_OFFSET(17211, glGetActiveAttribARB, glGetActiveAttribARB, NULL, _gloffset_GetActiveAttribARB),
- NAME_FUNC_OFFSET(17229, glGetAttribLocationARB, glGetAttribLocationARB, NULL, _gloffset_GetAttribLocationARB),
- NAME_FUNC_OFFSET(17249, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB),
- NAME_FUNC_OFFSET(17263, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB),
- NAME_FUNC_OFFSET(17280, gl_dispatch_stub_568, gl_dispatch_stub_568, NULL, _gloffset_SampleMaskSGIS),
- NAME_FUNC_OFFSET(17296, gl_dispatch_stub_569, gl_dispatch_stub_569, NULL, _gloffset_SamplePatternSGIS),
- NAME_FUNC_OFFSET(17315, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT),
- NAME_FUNC_OFFSET(17333, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT),
- NAME_FUNC_OFFSET(17354, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT),
- NAME_FUNC_OFFSET(17376, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT),
- NAME_FUNC_OFFSET(17395, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT),
- NAME_FUNC_OFFSET(17417, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT),
- NAME_FUNC_OFFSET(17440, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT),
- NAME_FUNC_OFFSET(17459, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT),
- NAME_FUNC_OFFSET(17479, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT),
- NAME_FUNC_OFFSET(17498, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT),
- NAME_FUNC_OFFSET(17518, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT),
- NAME_FUNC_OFFSET(17537, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT),
- NAME_FUNC_OFFSET(17557, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT),
- NAME_FUNC_OFFSET(17576, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT),
- NAME_FUNC_OFFSET(17596, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT),
- NAME_FUNC_OFFSET(17615, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT),
- NAME_FUNC_OFFSET(17635, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT),
- NAME_FUNC_OFFSET(17655, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT),
- NAME_FUNC_OFFSET(17676, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT),
- NAME_FUNC_OFFSET(17696, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT),
- NAME_FUNC_OFFSET(17717, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT),
- NAME_FUNC_OFFSET(17737, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT),
- NAME_FUNC_OFFSET(17758, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT),
- NAME_FUNC_OFFSET(17782, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT),
- NAME_FUNC_OFFSET(17800, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT),
- NAME_FUNC_OFFSET(17820, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT),
- NAME_FUNC_OFFSET(17838, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT),
- NAME_FUNC_OFFSET(17850, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT),
- NAME_FUNC_OFFSET(17863, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT),
- NAME_FUNC_OFFSET(17875, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT),
- NAME_FUNC_OFFSET(17888, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT),
- NAME_FUNC_OFFSET(17908, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT),
- NAME_FUNC_OFFSET(17932, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA),
- NAME_FUNC_OFFSET(17946, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA),
- NAME_FUNC_OFFSET(17963, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA),
- NAME_FUNC_OFFSET(17978, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA),
- NAME_FUNC_OFFSET(17996, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA),
- NAME_FUNC_OFFSET(18010, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA),
- NAME_FUNC_OFFSET(18027, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA),
- NAME_FUNC_OFFSET(18042, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA),
- NAME_FUNC_OFFSET(18060, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA),
- NAME_FUNC_OFFSET(18074, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA),
- NAME_FUNC_OFFSET(18091, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA),
- NAME_FUNC_OFFSET(18106, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA),
- NAME_FUNC_OFFSET(18124, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA),
- NAME_FUNC_OFFSET(18138, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA),
- NAME_FUNC_OFFSET(18155, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA),
- NAME_FUNC_OFFSET(18170, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA),
- NAME_FUNC_OFFSET(18188, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA),
- NAME_FUNC_OFFSET(18202, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA),
- NAME_FUNC_OFFSET(18219, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA),
- NAME_FUNC_OFFSET(18234, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA),
- NAME_FUNC_OFFSET(18252, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA),
- NAME_FUNC_OFFSET(18266, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA),
- NAME_FUNC_OFFSET(18283, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA),
- NAME_FUNC_OFFSET(18298, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA),
- NAME_FUNC_OFFSET(18316, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA),
- NAME_FUNC_OFFSET(18330, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA),
- NAME_FUNC_OFFSET(18347, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA),
- NAME_FUNC_OFFSET(18362, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA),
- NAME_FUNC_OFFSET(18380, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA),
- NAME_FUNC_OFFSET(18394, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA),
- NAME_FUNC_OFFSET(18411, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA),
- NAME_FUNC_OFFSET(18426, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA),
- NAME_FUNC_OFFSET(18444, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV),
- NAME_FUNC_OFFSET(18461, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV),
- NAME_FUNC_OFFSET(18481, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV),
- NAME_FUNC_OFFSET(18498, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV),
- NAME_FUNC_OFFSET(18524, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV),
- NAME_FUNC_OFFSET(18553, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV),
- NAME_FUNC_OFFSET(18568, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV),
- NAME_FUNC_OFFSET(18586, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV),
- NAME_FUNC_OFFSET(18605, gl_dispatch_stub_749, gl_dispatch_stub_749, NULL, _gloffset_BlendEquationSeparateEXT),
- NAME_FUNC_OFFSET(18629, gl_dispatch_stub_749, gl_dispatch_stub_749, NULL, _gloffset_BlendEquationSeparateEXT),
+ NAME_FUNC_OFFSET(16357, glVertexAttrib4bvARB, glVertexAttrib4bvARB, NULL, _gloffset_VertexAttrib4bvARB),
+ NAME_FUNC_OFFSET(16375, glVertexAttrib4dARB, glVertexAttrib4dARB, NULL, _gloffset_VertexAttrib4dARB),
+ NAME_FUNC_OFFSET(16392, glVertexAttrib4dvARB, glVertexAttrib4dvARB, NULL, _gloffset_VertexAttrib4dvARB),
+ NAME_FUNC_OFFSET(16410, glVertexAttrib4fARB, glVertexAttrib4fARB, NULL, _gloffset_VertexAttrib4fARB),
+ NAME_FUNC_OFFSET(16427, glVertexAttrib4fvARB, glVertexAttrib4fvARB, NULL, _gloffset_VertexAttrib4fvARB),
+ NAME_FUNC_OFFSET(16445, glVertexAttrib4ivARB, glVertexAttrib4ivARB, NULL, _gloffset_VertexAttrib4ivARB),
+ NAME_FUNC_OFFSET(16463, glVertexAttrib4sARB, glVertexAttrib4sARB, NULL, _gloffset_VertexAttrib4sARB),
+ NAME_FUNC_OFFSET(16480, glVertexAttrib4svARB, glVertexAttrib4svARB, NULL, _gloffset_VertexAttrib4svARB),
+ NAME_FUNC_OFFSET(16498, glVertexAttrib4ubvARB, glVertexAttrib4ubvARB, NULL, _gloffset_VertexAttrib4ubvARB),
+ NAME_FUNC_OFFSET(16517, glVertexAttrib4uivARB, glVertexAttrib4uivARB, NULL, _gloffset_VertexAttrib4uivARB),
+ NAME_FUNC_OFFSET(16536, glVertexAttrib4usvARB, glVertexAttrib4usvARB, NULL, _gloffset_VertexAttrib4usvARB),
+ NAME_FUNC_OFFSET(16555, glVertexAttribPointerARB, glVertexAttribPointerARB, NULL, _gloffset_VertexAttribPointerARB),
+ NAME_FUNC_OFFSET(16577, glBindBufferARB, glBindBufferARB, NULL, _gloffset_BindBufferARB),
+ NAME_FUNC_OFFSET(16590, glBufferDataARB, glBufferDataARB, NULL, _gloffset_BufferDataARB),
+ NAME_FUNC_OFFSET(16603, glBufferSubDataARB, glBufferSubDataARB, NULL, _gloffset_BufferSubDataARB),
+ NAME_FUNC_OFFSET(16619, glDeleteBuffersARB, glDeleteBuffersARB, NULL, _gloffset_DeleteBuffersARB),
+ NAME_FUNC_OFFSET(16635, glGenBuffersARB, glGenBuffersARB, NULL, _gloffset_GenBuffersARB),
+ NAME_FUNC_OFFSET(16648, glGetBufferParameterivARB, glGetBufferParameterivARB, NULL, _gloffset_GetBufferParameterivARB),
+ NAME_FUNC_OFFSET(16671, glGetBufferPointervARB, glGetBufferPointervARB, NULL, _gloffset_GetBufferPointervARB),
+ NAME_FUNC_OFFSET(16691, glGetBufferSubDataARB, glGetBufferSubDataARB, NULL, _gloffset_GetBufferSubDataARB),
+ NAME_FUNC_OFFSET(16710, glIsBufferARB, glIsBufferARB, NULL, _gloffset_IsBufferARB),
+ NAME_FUNC_OFFSET(16721, glMapBufferARB, glMapBufferARB, NULL, _gloffset_MapBufferARB),
+ NAME_FUNC_OFFSET(16733, glUnmapBufferARB, glUnmapBufferARB, NULL, _gloffset_UnmapBufferARB),
+ NAME_FUNC_OFFSET(16747, glBeginQueryARB, glBeginQueryARB, NULL, _gloffset_BeginQueryARB),
+ NAME_FUNC_OFFSET(16760, glDeleteQueriesARB, glDeleteQueriesARB, NULL, _gloffset_DeleteQueriesARB),
+ NAME_FUNC_OFFSET(16776, glEndQueryARB, glEndQueryARB, NULL, _gloffset_EndQueryARB),
+ NAME_FUNC_OFFSET(16787, glGenQueriesARB, glGenQueriesARB, NULL, _gloffset_GenQueriesARB),
+ NAME_FUNC_OFFSET(16800, glGetQueryObjectivARB, glGetQueryObjectivARB, NULL, _gloffset_GetQueryObjectivARB),
+ NAME_FUNC_OFFSET(16819, glGetQueryObjectuivARB, glGetQueryObjectuivARB, NULL, _gloffset_GetQueryObjectuivARB),
+ NAME_FUNC_OFFSET(16839, glGetQueryivARB, glGetQueryivARB, NULL, _gloffset_GetQueryivARB),
+ NAME_FUNC_OFFSET(16852, glIsQueryARB, glIsQueryARB, NULL, _gloffset_IsQueryARB),
+ NAME_FUNC_OFFSET(16862, glCompileShaderARB, glCompileShaderARB, NULL, _gloffset_CompileShaderARB),
+ NAME_FUNC_OFFSET(16878, glGetActiveUniformARB, glGetActiveUniformARB, NULL, _gloffset_GetActiveUniformARB),
+ NAME_FUNC_OFFSET(16897, glGetShaderSourceARB, glGetShaderSourceARB, NULL, _gloffset_GetShaderSourceARB),
+ NAME_FUNC_OFFSET(16915, glGetUniformLocationARB, glGetUniformLocationARB, NULL, _gloffset_GetUniformLocationARB),
+ NAME_FUNC_OFFSET(16936, glGetUniformfvARB, glGetUniformfvARB, NULL, _gloffset_GetUniformfvARB),
+ NAME_FUNC_OFFSET(16951, glGetUniformivARB, glGetUniformivARB, NULL, _gloffset_GetUniformivARB),
+ NAME_FUNC_OFFSET(16966, glLinkProgramARB, glLinkProgramARB, NULL, _gloffset_LinkProgramARB),
+ NAME_FUNC_OFFSET(16980, glShaderSourceARB, glShaderSourceARB, NULL, _gloffset_ShaderSourceARB),
+ NAME_FUNC_OFFSET(16995, glUniform1fARB, glUniform1fARB, NULL, _gloffset_Uniform1fARB),
+ NAME_FUNC_OFFSET(17007, glUniform1fvARB, glUniform1fvARB, NULL, _gloffset_Uniform1fvARB),
+ NAME_FUNC_OFFSET(17020, glUniform1iARB, glUniform1iARB, NULL, _gloffset_Uniform1iARB),
+ NAME_FUNC_OFFSET(17032, glUniform1ivARB, glUniform1ivARB, NULL, _gloffset_Uniform1ivARB),
+ NAME_FUNC_OFFSET(17045, glUniform2fARB, glUniform2fARB, NULL, _gloffset_Uniform2fARB),
+ NAME_FUNC_OFFSET(17057, glUniform2fvARB, glUniform2fvARB, NULL, _gloffset_Uniform2fvARB),
+ NAME_FUNC_OFFSET(17070, glUniform2iARB, glUniform2iARB, NULL, _gloffset_Uniform2iARB),
+ NAME_FUNC_OFFSET(17082, glUniform2ivARB, glUniform2ivARB, NULL, _gloffset_Uniform2ivARB),
+ NAME_FUNC_OFFSET(17095, glUniform3fARB, glUniform3fARB, NULL, _gloffset_Uniform3fARB),
+ NAME_FUNC_OFFSET(17107, glUniform3fvARB, glUniform3fvARB, NULL, _gloffset_Uniform3fvARB),
+ NAME_FUNC_OFFSET(17120, glUniform3iARB, glUniform3iARB, NULL, _gloffset_Uniform3iARB),
+ NAME_FUNC_OFFSET(17132, glUniform3ivARB, glUniform3ivARB, NULL, _gloffset_Uniform3ivARB),
+ NAME_FUNC_OFFSET(17145, glUniform4fARB, glUniform4fARB, NULL, _gloffset_Uniform4fARB),
+ NAME_FUNC_OFFSET(17157, glUniform4fvARB, glUniform4fvARB, NULL, _gloffset_Uniform4fvARB),
+ NAME_FUNC_OFFSET(17170, glUniform4iARB, glUniform4iARB, NULL, _gloffset_Uniform4iARB),
+ NAME_FUNC_OFFSET(17182, glUniform4ivARB, glUniform4ivARB, NULL, _gloffset_Uniform4ivARB),
+ NAME_FUNC_OFFSET(17195, glUniformMatrix2fvARB, glUniformMatrix2fvARB, NULL, _gloffset_UniformMatrix2fvARB),
+ NAME_FUNC_OFFSET(17214, glUniformMatrix3fvARB, glUniformMatrix3fvARB, NULL, _gloffset_UniformMatrix3fvARB),
+ NAME_FUNC_OFFSET(17233, glUniformMatrix4fvARB, glUniformMatrix4fvARB, NULL, _gloffset_UniformMatrix4fvARB),
+ NAME_FUNC_OFFSET(17252, glUseProgramObjectARB, glUseProgramObjectARB, NULL, _gloffset_UseProgramObjectARB),
+ NAME_FUNC_OFFSET(17265, glValidateProgramARB, glValidateProgramARB, NULL, _gloffset_ValidateProgramARB),
+ NAME_FUNC_OFFSET(17283, glBindAttribLocationARB, glBindAttribLocationARB, NULL, _gloffset_BindAttribLocationARB),
+ NAME_FUNC_OFFSET(17304, glGetActiveAttribARB, glGetActiveAttribARB, NULL, _gloffset_GetActiveAttribARB),
+ NAME_FUNC_OFFSET(17322, glGetAttribLocationARB, glGetAttribLocationARB, NULL, _gloffset_GetAttribLocationARB),
+ NAME_FUNC_OFFSET(17342, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB),
+ NAME_FUNC_OFFSET(17356, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB),
+ NAME_FUNC_OFFSET(17373, gl_dispatch_stub_568, gl_dispatch_stub_568, NULL, _gloffset_SampleMaskSGIS),
+ NAME_FUNC_OFFSET(17389, gl_dispatch_stub_569, gl_dispatch_stub_569, NULL, _gloffset_SamplePatternSGIS),
+ NAME_FUNC_OFFSET(17408, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT),
+ NAME_FUNC_OFFSET(17426, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT),
+ NAME_FUNC_OFFSET(17447, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT),
+ NAME_FUNC_OFFSET(17469, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT),
+ NAME_FUNC_OFFSET(17488, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT),
+ NAME_FUNC_OFFSET(17510, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT),
+ NAME_FUNC_OFFSET(17533, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT),
+ NAME_FUNC_OFFSET(17552, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT),
+ NAME_FUNC_OFFSET(17572, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT),
+ NAME_FUNC_OFFSET(17591, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT),
+ NAME_FUNC_OFFSET(17611, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT),
+ NAME_FUNC_OFFSET(17630, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT),
+ NAME_FUNC_OFFSET(17650, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT),
+ NAME_FUNC_OFFSET(17669, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT),
+ NAME_FUNC_OFFSET(17689, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT),
+ NAME_FUNC_OFFSET(17708, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT),
+ NAME_FUNC_OFFSET(17728, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT),
+ NAME_FUNC_OFFSET(17748, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT),
+ NAME_FUNC_OFFSET(17769, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT),
+ NAME_FUNC_OFFSET(17789, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT),
+ NAME_FUNC_OFFSET(17810, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT),
+ NAME_FUNC_OFFSET(17830, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT),
+ NAME_FUNC_OFFSET(17851, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT),
+ NAME_FUNC_OFFSET(17875, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT),
+ NAME_FUNC_OFFSET(17893, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT),
+ NAME_FUNC_OFFSET(17913, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT),
+ NAME_FUNC_OFFSET(17931, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT),
+ NAME_FUNC_OFFSET(17943, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT),
+ NAME_FUNC_OFFSET(17956, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT),
+ NAME_FUNC_OFFSET(17968, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT),
+ NAME_FUNC_OFFSET(17981, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT),
+ NAME_FUNC_OFFSET(18001, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT),
+ NAME_FUNC_OFFSET(18025, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA),
+ NAME_FUNC_OFFSET(18039, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA),
+ NAME_FUNC_OFFSET(18056, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA),
+ NAME_FUNC_OFFSET(18071, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA),
+ NAME_FUNC_OFFSET(18089, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA),
+ NAME_FUNC_OFFSET(18103, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA),
+ NAME_FUNC_OFFSET(18120, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA),
+ NAME_FUNC_OFFSET(18135, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA),
+ NAME_FUNC_OFFSET(18153, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA),
+ NAME_FUNC_OFFSET(18167, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA),
+ NAME_FUNC_OFFSET(18184, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA),
+ NAME_FUNC_OFFSET(18199, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA),
+ NAME_FUNC_OFFSET(18217, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA),
+ NAME_FUNC_OFFSET(18231, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA),
+ NAME_FUNC_OFFSET(18248, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA),
+ NAME_FUNC_OFFSET(18263, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA),
+ NAME_FUNC_OFFSET(18281, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA),
+ NAME_FUNC_OFFSET(18295, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA),
+ NAME_FUNC_OFFSET(18312, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA),
+ NAME_FUNC_OFFSET(18327, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA),
+ NAME_FUNC_OFFSET(18345, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA),
+ NAME_FUNC_OFFSET(18359, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA),
+ NAME_FUNC_OFFSET(18376, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA),
+ NAME_FUNC_OFFSET(18391, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA),
+ NAME_FUNC_OFFSET(18409, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA),
+ NAME_FUNC_OFFSET(18423, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA),
+ NAME_FUNC_OFFSET(18440, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA),
+ NAME_FUNC_OFFSET(18455, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA),
+ NAME_FUNC_OFFSET(18473, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA),
+ NAME_FUNC_OFFSET(18487, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA),
+ NAME_FUNC_OFFSET(18504, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA),
+ NAME_FUNC_OFFSET(18519, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA),
+ NAME_FUNC_OFFSET(18537, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV),
+ NAME_FUNC_OFFSET(18554, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV),
+ NAME_FUNC_OFFSET(18574, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV),
+ NAME_FUNC_OFFSET(18591, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV),
+ NAME_FUNC_OFFSET(18617, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV),
+ NAME_FUNC_OFFSET(18646, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV),
+ NAME_FUNC_OFFSET(18661, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV),
+ NAME_FUNC_OFFSET(18679, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV),
+ NAME_FUNC_OFFSET(18698, gl_dispatch_stub_749, gl_dispatch_stub_749, NULL, _gloffset_BlendEquationSeparateEXT),
+ NAME_FUNC_OFFSET(18722, gl_dispatch_stub_749, gl_dispatch_stub_749, NULL, _gloffset_BlendEquationSeparateEXT),
NAME_FUNC_OFFSET(-1, NULL, NULL, NULL, 0)
};
diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
index 5519924556..cebef1c383 100644
--- a/src/mesa/main/config.h
+++ b/src/mesa/main/config.h
@@ -82,7 +82,7 @@
/** Minimum point size */
#define MIN_POINT_SIZE 1.0
/** Maximum point size */
-#define MAX_POINT_SIZE 20.0
+#define MAX_POINT_SIZE 60.0
/** Point size granularity */
#define POINT_SIZE_GRANULARITY 0.1
diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h
index 5abea137d7..63dd002a41 100644
--- a/src/mesa/main/glheader.h
+++ b/src/mesa/main/glheader.h
@@ -91,6 +91,9 @@
# pragma disable_message(201) /* Disable unreachable code warnings */
#endif
+#ifdef WGLAPI
+#undef WGLAPI
+#endif
#if !defined(OPENSTEP) && (defined(__WIN32__) && !defined(__CYGWIN__)) && !defined(BUILD_FOR_SNAP)
# if !defined(__GNUC__) /* mingw environment */
diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c
index ca5f079f72..8a5dfdb4b8 100644
--- a/src/mesa/main/imports.c
+++ b/src/mesa/main/imports.c
@@ -20,7 +20,7 @@
/*
* Mesa 3-D graphics library
- * Version: 7.0
+ * Version: 7.1
*
* Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
*
@@ -254,7 +254,7 @@ _mesa_memset16( unsigned short *dst, unsigned short val, size_t n )
*dst++ = val;
}
-/** Wrapper around either memcpy() or bzero() */
+/** Wrapper around either memset() or bzero() */
void
_mesa_bzero( void *dst, size_t n )
{
diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c
index 8674c7299c..0f562420b0 100644
--- a/src/mesa/main/points.c
+++ b/src/mesa/main/points.c
@@ -57,6 +57,7 @@ _mesa_PointSize( GLfloat size )
FLUSH_VERTICES(ctx, _NEW_POINT);
ctx->Point.Size = size;
+ /* XXX correct clamp limits? */
ctx->Point._Size = CLAMP(ctx->Point.Size,
ctx->Point.MinSize,
ctx->Point.MaxSize);
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index f315c3de74..f902365b9b 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 7.1
*
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -3768,7 +3768,7 @@ _mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset,
width, height, depth, /*size*/
format, imageSize);
if (error) {
- _mesa_error(ctx, error, "glCompressedTexSubImage2D");
+ _mesa_error(ctx, error, "glCompressedTexSubImage3D");
return;
}
@@ -3819,7 +3819,6 @@ _mesa_GetCompressedTexImageARB(GLenum target, GLint level, GLvoid *img)
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
texObj = _mesa_select_tex_object(ctx, texUnit, target);
if (!texObj) {
@@ -3840,24 +3839,25 @@ _mesa_GetCompressedTexImageARB(GLenum target, GLint level, GLvoid *img)
return;
}
-
_mesa_lock_texture(ctx, texObj);
{
texImage = _mesa_select_tex_image(ctx, texObj, target, level);
- if (!texImage) {
- /* probably invalid mipmap level */
- _mesa_error(ctx, GL_INVALID_VALUE, "glGetCompressedTexImageARB(level)");
- goto out;
+ if (texImage) {
+ if (texImage->IsCompressed) {
+ /* this typically calls _mesa_get_compressed_teximage() */
+ ctx->Driver.GetCompressedTexImage(ctx, target, level, img,
+ texObj, texImage);
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glGetCompressedTexImageARB");
+ }
}
-
- if (!texImage->IsCompressed) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glGetCompressedTexImageARB");
- goto out;
+ else {
+ /* probably invalid mipmap level */
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glGetCompressedTexImageARB(level)");
}
-
- /* this typically calls _mesa_get_compressed_teximage() */
- ctx->Driver.GetCompressedTexImage(ctx, target, level, img, texObj,texImage);
}
- out:
_mesa_unlock_texture(ctx, texObj);
}
diff --git a/src/mesa/sparc/glapi_sparc.S b/src/mesa/sparc/glapi_sparc.S
index d4ea12870f..8725c7ee4d 100644
--- a/src/mesa/sparc/glapi_sparc.S
+++ b/src/mesa/sparc/glapi_sparc.S
@@ -1733,12 +1733,17 @@ _mesa_sparc_glapi_end:
.globl glVertexAttrib4Nubv ; .type glVertexAttrib4Nubv,#function ; glVertexAttrib4Nubv = glVertexAttrib4NubvARB
.globl glVertexAttrib4Nuiv ; .type glVertexAttrib4Nuiv,#function ; glVertexAttrib4Nuiv = glVertexAttrib4NuivARB
.globl glVertexAttrib4Nusv ; .type glVertexAttrib4Nusv,#function ; glVertexAttrib4Nusv = glVertexAttrib4NusvARB
+ .globl glVertexAttrib4bv ; .type glVertexAttrib4bv,#function ; glVertexAttrib4bv = glVertexAttrib4bvARB
.globl glVertexAttrib4d ; .type glVertexAttrib4d,#function ; glVertexAttrib4d = glVertexAttrib4dARB
.globl glVertexAttrib4dv ; .type glVertexAttrib4dv,#function ; glVertexAttrib4dv = glVertexAttrib4dvARB
.globl glVertexAttrib4f ; .type glVertexAttrib4f,#function ; glVertexAttrib4f = glVertexAttrib4fARB
.globl glVertexAttrib4fv ; .type glVertexAttrib4fv,#function ; glVertexAttrib4fv = glVertexAttrib4fvARB
+ .globl glVertexAttrib4iv ; .type glVertexAttrib4iv,#function ; glVertexAttrib4iv = glVertexAttrib4ivARB
.globl glVertexAttrib4s ; .type glVertexAttrib4s,#function ; glVertexAttrib4s = glVertexAttrib4sARB
.globl glVertexAttrib4sv ; .type glVertexAttrib4sv,#function ; glVertexAttrib4sv = glVertexAttrib4svARB
+ .globl glVertexAttrib4ubv ; .type glVertexAttrib4ubv,#function ; glVertexAttrib4ubv = glVertexAttrib4ubvARB
+ .globl glVertexAttrib4uiv ; .type glVertexAttrib4uiv,#function ; glVertexAttrib4uiv = glVertexAttrib4uivARB
+ .globl glVertexAttrib4usv ; .type glVertexAttrib4usv,#function ; glVertexAttrib4usv = glVertexAttrib4usvARB
.globl glVertexAttribPointer ; .type glVertexAttribPointer,#function ; glVertexAttribPointer = glVertexAttribPointerARB
.globl glBindBuffer ; .type glBindBuffer,#function ; glBindBuffer = glBindBufferARB
.globl glBufferData ; .type glBufferData,#function ; glBufferData = glBufferDataARB
diff --git a/src/mesa/swrast/s_aalinetemp.h b/src/mesa/swrast/s_aalinetemp.h
index 3d3511823d..69a1f0cd39 100644
--- a/src/mesa/swrast/s_aalinetemp.h
+++ b/src/mesa/swrast/s_aalinetemp.h
@@ -137,8 +137,8 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1)
if (line.len == 0.0 || IS_INF_OR_NAN(line.len))
return;
- INIT_SPAN(line.span, GL_LINE, 0, 0, SPAN_XY | SPAN_COVERAGE);
-
+ INIT_SPAN(line.span, GL_LINE);
+ line.span.arrayMask = SPAN_XY | SPAN_COVERAGE;
line.xAdj = line.dx / line.len * line.halfWidth;
line.yAdj = line.dy / line.len * line.halfWidth;
diff --git a/src/mesa/swrast/s_aatritemp.h b/src/mesa/swrast/s_aatritemp.h
index 34a2305b39..42d74a1632 100644
--- a/src/mesa/swrast/s_aatritemp.h
+++ b/src/mesa/swrast/s_aatritemp.h
@@ -69,7 +69,8 @@
(void) swrast;
- INIT_SPAN(span, GL_POLYGON, 0, 0, SPAN_COVERAGE);
+ INIT_SPAN(span, GL_POLYGON);
+ span.arrayMask = SPAN_COVERAGE;
/* determine bottom to top order of vertices */
{
diff --git a/src/mesa/swrast/s_accum.c b/src/mesa/swrast/s_accum.c
index f53e7f52c5..3c45dee399 100644
--- a/src/mesa/swrast/s_accum.c
+++ b/src/mesa/swrast/s_accum.c
@@ -474,7 +474,9 @@ accum_return(GLcontext *ctx, GLfloat value,
SWspan span;
/* init color span */
- INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_RGBA);
+ INIT_SPAN(span, GL_BITMAP);
+ span.end = width;
+ span.arrayMask = SPAN_RGBA;
span.x = xpos;
span.y = ypos + i;
diff --git a/src/mesa/swrast/s_bitmap.c b/src/mesa/swrast/s_bitmap.c
index 563b5fe602..1e7f6c18e6 100644
--- a/src/mesa/swrast/s_bitmap.c
+++ b/src/mesa/swrast/s_bitmap.c
@@ -82,7 +82,9 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
if (SWRAST_CONTEXT(ctx)->NewState)
_swrast_validate_derived( ctx );
- INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_XY);
+ INIT_SPAN(span, GL_BITMAP);
+ span.end = width;
+ span.arrayMask = SPAN_XY;
_swrast_span_default_attribs(ctx, &span);
for (row = 0; row < height; row++) {
@@ -180,7 +182,9 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
if (SWRAST_CONTEXT(ctx)->NewState)
_swrast_validate_derived( ctx );
- INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_MASK);
+ INIT_SPAN(span, GL_BITMAP);
+ span.end = width;
+ span.arrayMask = SPAN_MASK;
_swrast_span_default_attribs(ctx, &span);
/*span.arrayMask |= SPAN_MASK;*/ /* we'll init span.mask[] */
diff --git a/src/mesa/swrast/s_buffers.c b/src/mesa/swrast/s_buffers.c
index 35f2dd6490..90a56284c5 100644
--- a/src/mesa/swrast/s_buffers.c
+++ b/src/mesa/swrast/s_buffers.c
@@ -55,7 +55,9 @@ clear_rgba_buffer_with_masking(GLcontext *ctx, struct gl_renderbuffer *rb)
/* Initialize color span with clear color */
/* XXX optimize for clearcolor == black/zero (bzero) */
- INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_RGBA);
+ INIT_SPAN(span, GL_BITMAP);
+ span.end = width;
+ span.arrayMask = SPAN_RGBA;
span.array->ChanType = rb->DataType;
if (span.array->ChanType == GL_UNSIGNED_BYTE) {
GLubyte clearColor[4];
@@ -119,7 +121,9 @@ clear_ci_buffer_with_masking(GLcontext *ctx, struct gl_renderbuffer *rb)
ASSERT(rb->DataType == GL_UNSIGNED_INT);
/* Initialize index span with clear index */
- INIT_SPAN(span, GL_BITMAP, width, 0, SPAN_RGBA);
+ INIT_SPAN(span, GL_BITMAP);
+ span.end = width;
+ span.arrayMask = SPAN_INDEX;
for (i = 0; i < width;i++) {
span.array->index[i] = ctx->Color.ClearIndex;
}
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index cb3bc756a4..791850cb50 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -535,10 +535,11 @@ _swrast_update_texture_samplers(GLcontext *ctx)
/**
- * Update swrast->_ActiveAttribs, swrast->_NumActiveAttribs, swrast->_ActiveAtttribMask.
+ * Update swrast->_ActiveAttribs, swrast->_NumActiveAttribs,
+ * swrast->_ActiveAtttribMask.
*/
static void
-_swrast_update_fragment_attribs(GLcontext *ctx)
+_swrast_update_active_attribs(GLcontext *ctx)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLuint attribsMask;
@@ -679,7 +680,7 @@ _swrast_validate_derived( GLcontext *ctx )
_NEW_LIGHT |
_NEW_PROGRAM |
_NEW_TEXTURE))
- _swrast_update_fragment_attribs(ctx);
+ _swrast_update_active_attribs(ctx);
if (swrast->NewState & (_NEW_PROGRAM | _NEW_BUFFERS))
_swrast_update_color_outputs(ctx);
diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c
index 53e584b3b6..bbe1081860 100644
--- a/src/mesa/swrast/s_copypix.c
+++ b/src/mesa/swrast/s_copypix.c
@@ -102,8 +102,10 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
GLfloat *dest, *tmpImage, *convImage;
SWspan span;
- INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA);
+ INIT_SPAN(span, GL_BITMAP);
_swrast_span_default_attribs(ctx, &span);
+ span.arrayMask = SPAN_RGBA;
+ span.arrayAttribs = FRAG_BIT_COL0;
/* allocate space for GLfloat image */
tmpImage = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat));
@@ -156,7 +158,7 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
/* write the new image */
for (row = 0; row < height; row++) {
const GLfloat *src = convImage + row * width * 4;
- GLvoid *rgba = (GLvoid *) span.array->attribs[FRAG_ATTRIB_COL0];
+ GLfloat *rgba = (GLfloat *) span.array->attribs[FRAG_ATTRIB_COL0];
/* copy convolved colors into span array */
_mesa_memcpy(rgba, src, width * 4 * sizeof(GLfloat));
@@ -232,8 +234,10 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
stepy = 1;
}
- INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA);
+ INIT_SPAN(span, GL_BITMAP);
_swrast_span_default_attribs(ctx, &span);
+ span.arrayMask = SPAN_RGBA;
+ span.arrayAttribs = FRAG_BIT_COL0; /* we'll fill in COL0 attrib values */
if (overlapping) {
tmpImage = (GLfloat *) _mesa_malloc(width * height * sizeof(GLfloat) * 4);
@@ -314,8 +318,9 @@ copy_ci_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
return;
}
- INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_INDEX);
+ INIT_SPAN(span, GL_BITMAP);
_swrast_span_default_attribs(ctx, &span);
+ span.arrayMask = SPAN_INDEX;
if (ctx->DrawBuffer == ctx->ReadBuffer) {
overlapping = regions_overlap(srcx, srcy, destx, desty, width, height,
@@ -448,8 +453,9 @@ copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
return;
}
- INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_Z);
+ INIT_SPAN(span, GL_BITMAP);
_swrast_span_default_attribs(ctx, &span);
+ span.arrayMask = SPAN_Z;
if (ctx->DrawBuffer == ctx->ReadBuffer) {
overlapping = regions_overlap(srcx, srcy, destx, desty, width, height,
diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c
index d971d90fb9..b8b452e33d 100644
--- a/src/mesa/swrast/s_drawpix.c
+++ b/src/mesa/swrast/s_drawpix.c
@@ -70,7 +70,9 @@ fast_draw_rgba_pixels(GLcontext *ctx, GLint x, GLint y,
return GL_FALSE;
}
- INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_RGBA);
+ INIT_SPAN(span, GL_BITMAP);
+ span.arrayMask = SPAN_RGBA;
+ span.arrayAttribs = FRAG_BIT_COL0;
_swrast_span_default_attribs(ctx, &span);
/* copy input params since clipping may change them */
@@ -332,7 +334,8 @@ draw_index_pixels( GLcontext *ctx, GLint x, GLint y,
GLint row, skipPixels;
SWspan span;
- INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_INDEX);
+ INIT_SPAN(span, GL_BITMAP);
+ span.arrayMask = SPAN_INDEX;
_swrast_span_default_attribs(ctx, &span);
/*
@@ -427,7 +430,8 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0;
SWspan span;
- INIT_SPAN(span, GL_BITMAP, 0, 0, SPAN_Z);
+ INIT_SPAN(span, GL_BITMAP);
+ span.arrayMask = SPAN_Z;
_swrast_span_default_attribs(ctx, &span);
if (type == GL_UNSIGNED_SHORT
@@ -540,11 +544,14 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y,
/* Try an optimized glDrawPixels first */
if (fast_draw_rgba_pixels(ctx, x, y, width, height, format, type,
- unpack, pixels))
+ unpack, pixels)) {
return;
+ }
- INIT_SPAN(span, GL_BITMAP, 0, 0x0, SPAN_RGBA);
+ INIT_SPAN(span, GL_BITMAP);
_swrast_span_default_attribs(ctx, &span);
+ span.arrayMask = SPAN_RGBA;
+ span.arrayAttribs = FRAG_BIT_COL0; /* we're fill in COL0 attrib values */
if (ctx->Pixel.Convolution2DEnabled || ctx->Pixel.Separable2DEnabled) {
/* Convolution has to be handled specially. We'll create an
diff --git a/src/mesa/swrast/s_feedback.c b/src/mesa/swrast/s_feedback.c
index 606afc63ba..07b7409ab5 100644
--- a/src/mesa/swrast/s_feedback.c
+++ b/src/mesa/swrast/s_feedback.c
@@ -39,19 +39,14 @@ static void
feedback_vertex(GLcontext * ctx, const SWvertex * v, const SWvertex * pv)
{
GLfloat win[4];
- GLfloat color[4];
const GLfloat *vtc = v->attrib[FRAG_ATTRIB_TEX0];
+ const GLfloat *color = v->attrib[FRAG_ATTRIB_COL0];
win[0] = v->attrib[FRAG_ATTRIB_WPOS][0];
win[1] = v->attrib[FRAG_ATTRIB_WPOS][1];
win[2] = v->attrib[FRAG_ATTRIB_WPOS][2] / ctx->DrawBuffer->_DepthMaxF;
win[3] = 1.0F / v->attrib[FRAG_ATTRIB_WPOS][3];
- color[0] = CHAN_TO_FLOAT(pv->color[0]);
- color[1] = CHAN_TO_FLOAT(pv->color[1]);
- color[2] = CHAN_TO_FLOAT(pv->color[2]);
- color[3] = CHAN_TO_FLOAT(pv->color[3]);
-
_mesa_feedback_vertex(ctx, win, color, v->attrib[FRAG_ATTRIB_CI][0], vtc);
}
diff --git a/src/mesa/swrast/s_linetemp.h b/src/mesa/swrast/s_linetemp.h
index 55548f27b0..1accfc67e2 100644
--- a/src/mesa/swrast/s_linetemp.h
+++ b/src/mesa/swrast/s_linetemp.h
@@ -303,7 +303,10 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 )
}
#endif
- INIT_SPAN(span, GL_LINE, numPixels, interpFlags, SPAN_XY);
+ INIT_SPAN(span, GL_LINE);
+ span.end = numPixels;
+ span.interpMask = interpFlags;
+ span.arrayMask = SPAN_XY;
/*
* Draw
diff --git a/src/mesa/swrast/s_points.c b/src/mesa/swrast/s_points.c
index 02c9d9b425..8eba53c807 100644
--- a/src/mesa/swrast/s_points.c
+++ b/src/mesa/swrast/s_points.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.1
+ * Version: 7.1
*
- * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -34,134 +34,493 @@
#include "s_span.h"
-#define RGBA 0x1
-#define INDEX 0x2
-#define SMOOTH 0x4
-#define ATTRIBS 0x8
-#define SPECULAR 0x10
-#define LARGE 0x20
-#define ATTENUATE 0x40
-#define SPRITE 0x80
-
-
-/*
- * CI points with size == 1.0
- */
-#define FLAGS (INDEX)
-#define NAME size1_ci_point
-#include "s_pointtemp.h"
-
-
-/*
- * General CI points.
+/**
+ * Used to cull points with invalid coords
*/
-#define FLAGS (INDEX | LARGE)
-#define NAME general_ci_point
-#include "s_pointtemp.h"
+#define CULL_INVALID(V) \
+ do { \
+ float tmp = (V)->attrib[FRAG_ATTRIB_WPOS][0] \
+ + (V)->attrib[FRAG_ATTRIB_WPOS][1]; \
+ if (IS_INF_OR_NAN(tmp)) \
+ return; \
+ } while(0)
-/*
- * Antialiased CI points.
+/**
+ * Draw a point sprite
*/
-#define FLAGS (INDEX | SMOOTH)
-#define NAME antialiased_ci_point
-#include "s_pointtemp.h"
+static void
+sprite_point(GLcontext *ctx, const SWvertex *vert)
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ SWspan span;
+ GLfloat size;
+ GLuint tCoords[MAX_TEXTURE_COORD_UNITS];
+ GLuint numTcoords = 0;
+ GLfloat t0, dtdy;
+
+ CULL_INVALID(vert);
+
+ /* z coord */
+ if (ctx->DrawBuffer->Visual.depthBits <= 16)
+ span.z = FloatToFixed(vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F);
+ else
+ span.z = (GLuint) (vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F);
+ span.zStep = 0;
+
+ /* compute size */
+ if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled) {
+ /* use vertex's point size */
+ /* first, clamp attenuated size to the user-specifed range */
+ size = CLAMP(vert->pointSize, ctx->Point.MinSize, ctx->Point.MaxSize);
+ }
+ else {
+ /* use constant point size */
+ size = ctx->Point._Size; /* already clamped to user range */
+ }
+ /* clamp to non-AA implementation limits */
+ size = CLAMP(size, ctx->Const.MinPointSize, ctx->Const.MaxPointSize);
+
+ /* span init */
+ INIT_SPAN(span, GL_POINT);
+ span.interpMask = SPAN_Z | SPAN_RGBA;
+
+ span.red = ChanToFixed(vert->color[0]);
+ span.green = ChanToFixed(vert->color[1]);
+ span.blue = ChanToFixed(vert->color[2]);
+ span.alpha = ChanToFixed(vert->color[3]);
+ span.redStep = 0;
+ span.greenStep = 0;
+ span.blueStep = 0;
+ span.alphaStep = 0;
+
+ /* need these for fragment programs */
+ span.attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F;
+ span.attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0F;
+ span.attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0F;
+
+ ATTRIB_LOOP_BEGIN
+ if (attr >= FRAG_ATTRIB_TEX0 && attr < FRAG_ATTRIB_VAR0) {
+ const GLuint u = attr - FRAG_ATTRIB_TEX0;
+ /* a texcoord */
+ if (ctx->Point.CoordReplace[u]) {
+ GLfloat s, r, dsdx;
+
+ s = 0.0;
+ dsdx = 1.0 / size;
+
+ if (ctx->Point.SpriteOrigin == GL_LOWER_LEFT) {
+ t0 = 0.0;
+ dtdy = 1.0 / size;
+ }
+ else {
+ /* GL_UPPER_LEFT */
+ t0 = 1.0;
+ dtdy = -1.0 / size;
+ }
+ tCoords[numTcoords++] = attr;
+
+ if (ctx->Point.SpriteRMode == GL_ZERO)
+ r = 0.0F;
+ else if (ctx->Point.SpriteRMode == GL_S)
+ r = vert->attrib[attr][0];
+ else /* GL_R */
+ r = vert->attrib[attr][2];
+
+ span.attrStart[attr][0] = s;
+ span.attrStart[attr][1] = 0.0; /* overwritten below */
+ span.attrStart[attr][2] = r;
+ span.attrStart[attr][3] = 1.0;
+
+ span.attrStepX[attr][0] = dsdx;
+ span.attrStepX[attr][1] = 0.0;
+ span.attrStepX[attr][2] = 0.0;
+ span.attrStepX[attr][3] = 0.0;
+
+ span.attrStepY[attr][0] = 0.0;
+ span.attrStepY[attr][1] = dtdy;
+ span.attrStepY[attr][2] = 0.0;
+ span.attrStepY[attr][3] = 0.0;
+
+ continue;
+ }
+ }
+ /* use vertex's texcoord/attrib */
+ COPY_4V(span.attrStart[attr], vert->attrib[attr]);
+ ASSIGN_4V(span.attrStepX[attr], 0, 0, 0, 0);
+ ASSIGN_4V(span.attrStepY[attr], 0, 0, 0, 0);
+ ATTRIB_LOOP_END
+
+ /* compute pos, bounds and render */
+ {
+ const GLfloat x = vert->attrib[FRAG_ATTRIB_WPOS][0];
+ const GLfloat y = vert->attrib[FRAG_ATTRIB_WPOS][1];
+ GLint iSize = (GLint) (size + 0.5F);
+ GLint xmin, xmax, ymin, ymax, iy;
+ GLint iRadius;
+ GLfloat tcoord = t0;
+
+ iSize = MAX2(1, iSize);
+ iRadius = iSize / 2;
+
+ if (iSize & 1) {
+ /* odd size */
+ xmin = (GLint) (x - iRadius);
+ xmax = (GLint) (x + iRadius);
+ ymin = (GLint) (y - iRadius);
+ ymax = (GLint) (y + iRadius);
+ }
+ else {
+ /* even size */
+ xmin = (GLint) x - iRadius + 1;
+ xmax = xmin + iSize - 1;
+ ymin = (GLint) y - iRadius + 1;
+ ymax = ymin + iSize - 1;
+ }
+ /* render spans */
+ for (iy = ymin; iy <= ymax; iy++) {
+ GLuint i;
+ /* setup texcoord T for this row */
+ for (i = 0; i < numTcoords; i++) {
+ span.attrStart[tCoords[i]][1] = tcoord;
+ }
-/*
- * Distance attenuated, general CI points.
- */
-#define FLAGS (INDEX | ATTENUATE)
-#define NAME atten_general_ci_point
-#include "s_pointtemp.h"
+ /* these might get changed by span clipping */
+ span.x = xmin;
+ span.y = iy;
+ span.end = xmax - xmin + 1;
+ _swrast_write_rgba_span(ctx, &span);
-/*
- * RGBA points with size == 1.0
- */
-#define FLAGS (RGBA)
-#define NAME size1_rgba_point
-#include "s_pointtemp.h"
+ tcoord += dtdy;
+ }
+ }
+}
-/*
- * General RGBA points.
+/**
+ * Draw smooth/antialiased point. RGB or CI mode.
*/
-#define FLAGS (RGBA | LARGE)
-#define NAME general_rgba_point
-#include "s_pointtemp.h"
-
+static void
+smooth_point(GLcontext *ctx, const SWvertex *vert)
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ const GLboolean ciMode = !ctx->Visual.rgbMode;
+ SWspan span;
+ GLfloat size, alphaAtten;
+
+ CULL_INVALID(vert);
+
+ /* z coord */
+ if (ctx->DrawBuffer->Visual.depthBits <= 16)
+ span.z = FloatToFixed(vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F);
+ else
+ span.z = (GLuint) (vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F);
+ span.zStep = 0;
+
+ /* compute size */
+ if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled) {
+ /* use vertex's point size */
+ /* first, clamp attenuated size to the user-specifed range */
+ size = CLAMP(vert->pointSize, ctx->Point.MinSize, ctx->Point.MaxSize);
+ }
+ else {
+ /* use constant point size */
+ size = ctx->Point._Size; /* this is already clamped */
+ }
+ /* clamp to AA implementation limits */
+ size = CLAMP(size, ctx->Const.MinPointSizeAA, ctx->Const.MaxPointSizeAA);
-/*
- * Antialiased RGBA points.
- */
-#define FLAGS (RGBA | SMOOTH)
-#define NAME antialiased_rgba_point
-#include "s_pointtemp.h"
+ /* alpha attenuation / fade factor */
+ if (ctx->Multisample.Enabled) {
+ if (vert->pointSize >= ctx->Point.Threshold) {
+ alphaAtten = 1.0F;
+ }
+ else {
+ GLfloat dsize = vert->pointSize / ctx->Point.Threshold;
+ alphaAtten = dsize * dsize;
+ }
+ }
+ else {
+ alphaAtten = 1.0;
+ }
+ (void) alphaAtten; /* not used */
+
+ /* span init */
+ INIT_SPAN(span, GL_POINT);
+ span.interpMask = SPAN_Z | SPAN_RGBA;
+ span.arrayMask = SPAN_COVERAGE | SPAN_MASK;
+
+ span.red = ChanToFixed(vert->color[0]);
+ span.green = ChanToFixed(vert->color[1]);
+ span.blue = ChanToFixed(vert->color[2]);
+ span.alpha = ChanToFixed(vert->color[3]);
+ span.redStep = 0;
+ span.greenStep = 0;
+ span.blueStep = 0;
+ span.alphaStep = 0;
+
+ /* need these for fragment programs */
+ span.attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F;
+ span.attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0F;
+ span.attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0F;
+
+ ATTRIB_LOOP_BEGIN
+ COPY_4V(span.attrStart[attr], vert->attrib[attr]);
+ ASSIGN_4V(span.attrStepX[attr], 0, 0, 0, 0);
+ ASSIGN_4V(span.attrStepY[attr], 0, 0, 0, 0);
+ ATTRIB_LOOP_END
+
+ /* compute pos, bounds and render */
+ {
+ const GLfloat x = vert->attrib[FRAG_ATTRIB_WPOS][0];
+ const GLfloat y = vert->attrib[FRAG_ATTRIB_WPOS][1];
+ const GLfloat radius = 0.5F * size;
+ const GLfloat rmin = radius - 0.7071F; /* 0.7071 = sqrt(2)/2 */
+ const GLfloat rmax = radius + 0.7071F;
+ const GLfloat rmin2 = MAX2(0.0F, rmin * rmin);
+ const GLfloat rmax2 = rmax * rmax;
+ const GLfloat cscale = 1.0F / (rmax2 - rmin2);
+ const GLint xmin = (GLint) (x - radius);
+ const GLint xmax = (GLint) (x + radius);
+ const GLint ymin = (GLint) (y - radius);
+ const GLint ymax = (GLint) (y + radius);
+ GLint ix, iy;
+
+ for (iy = ymin; iy <= ymax; iy++) {
+
+ /* these might get changed by span clipping */
+ span.x = xmin;
+ span.y = iy;
+ span.end = xmax - xmin + 1;
+
+ /* compute coverage for each pixel in span */
+ for (ix = xmin; ix <= xmax; ix++) {
+ const GLfloat dx = ix - x + 0.5F;
+ const GLfloat dy = iy - y + 0.5F;
+ const GLfloat dist2 = dx * dx + dy * dy;
+ GLfloat coverage;
+
+ if (dist2 < rmax2) {
+ if (dist2 >= rmin2) {
+ /* compute partial coverage */
+ coverage = 1.0F - (dist2 - rmin2) * cscale;
+ if (ciMode) {
+ /* coverage in [0,15] */
+ coverage *= 15.0;
+ }
+ }
+ else {
+ /* full coverage */
+ coverage = 1.0F;
+ }
+ span.array->mask[ix - xmin] = 1;
+ }
+ else {
+ /* zero coverage - fragment outside the radius */
+ coverage = 0.0;
+ span.array->mask[ix - xmin] = 0;
+ }
+ span.array->coverage[ix - xmin] = coverage;
+ }
+ /* render span */
+ _swrast_write_rgba_span(ctx, &span);
-/*
- * Textured RGBA points.
- */
-#define FLAGS (RGBA | LARGE | ATTRIBS | SPECULAR)
-#define NAME textured_rgba_point
-#include "s_pointtemp.h"
+ }
+ }
+}
-/*
- * Antialiased points with texture mapping.
+/**
+ * Draw large (size >= 1) non-AA point. RGB or CI mode.
*/
-#define FLAGS (RGBA | SMOOTH | ATTRIBS | SPECULAR)
-#define NAME antialiased_tex_rgba_point
-#include "s_pointtemp.h"
+static void
+large_point(GLcontext *ctx, const SWvertex *vert)
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ const GLboolean ciMode = !ctx->Visual.rgbMode;
+ SWspan span;
+ GLfloat size;
+
+ CULL_INVALID(vert);
+
+ /* z coord */
+ if (ctx->DrawBuffer->Visual.depthBits <= 16)
+ span.z = FloatToFixed(vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F);
+ else
+ span.z = (GLuint) (vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F);
+ span.zStep = 0;
+
+ /* compute size */
+ if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled) {
+ /* use vertex's point size */
+ /* first, clamp attenuated size to the user-specifed range */
+ size = CLAMP(vert->pointSize, ctx->Point.MinSize, ctx->Point.MaxSize);
+ }
+ else {
+ /* use constant point size */
+ size = ctx->Point._Size; /* already clamped to user range */
+ }
+ /* clamp to non-AA implementation limits */
+ size = CLAMP(size, ctx->Const.MinPointSize, ctx->Const.MaxPointSize);
+ /* span init */
+ INIT_SPAN(span, GL_POINT);
+ span.arrayMask = SPAN_XY;
-/*
- * Distance attenuated, general RGBA points.
- */
-#define FLAGS (RGBA | ATTENUATE)
-#define NAME atten_general_rgba_point
-#include "s_pointtemp.h"
+ if (ciMode) {
+ span.interpMask = SPAN_Z | SPAN_INDEX;
+ span.index = FloatToFixed(vert->attrib[FRAG_ATTRIB_CI][0]);
+ span.indexStep = 0;
+ }
+ else {
+ span.interpMask = SPAN_Z | SPAN_RGBA;
+ span.red = ChanToFixed(vert->color[0]);
+ span.green = ChanToFixed(vert->color[1]);
+ span.blue = ChanToFixed(vert->color[2]);
+ span.alpha = ChanToFixed(vert->color[3]);
+ span.redStep = 0;
+ span.greenStep = 0;
+ span.blueStep = 0;
+ span.alphaStep = 0;
+ }
+ /* need these for fragment programs */
+ span.attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F;
+ span.attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0F;
+ span.attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0F;
+
+ ATTRIB_LOOP_BEGIN
+ COPY_4V(span.attrStart[attr], vert->attrib[attr]);
+ ASSIGN_4V(span.attrStepX[attr], 0, 0, 0, 0);
+ ASSIGN_4V(span.attrStepY[attr], 0, 0, 0, 0);
+ ATTRIB_LOOP_END
+
+ /* compute pos, bounds and render */
+ {
+ const GLfloat x = vert->attrib[FRAG_ATTRIB_WPOS][0];
+ const GLfloat y = vert->attrib[FRAG_ATTRIB_WPOS][1];
+ GLint iSize = (GLint) (size + 0.5F);
+ GLint xmin, xmax, ymin, ymax, ix, iy;
+ GLint iRadius;
+
+ iSize = MAX2(1, iSize);
+ iRadius = iSize / 2;
+
+ if (iSize & 1) {
+ /* odd size */
+ xmin = (GLint) (x - iRadius);
+ xmax = (GLint) (x + iRadius);
+ ymin = (GLint) (y - iRadius);
+ ymax = (GLint) (y + iRadius);
+ }
+ else {
+ /* even size */
+ xmin = (GLint) x - iRadius + 1;
+ xmax = xmin + iSize - 1;
+ ymin = (GLint) y - iRadius + 1;
+ ymax = ymin + iSize - 1;
+ }
-/*
- * Distance attenuated, textured RGBA points.
- */
-#define FLAGS (RGBA | ATTENUATE | ATTRIBS | SPECULAR)
-#define NAME atten_textured_rgba_point
-#include "s_pointtemp.h"
+ /* generate fragments */
+ span.end = 0;
+ for (iy = ymin; iy <= ymax; iy++) {
+ for (ix = xmin; ix <= xmax; ix++) {
+ span.array->x[span.end] = ix;
+ span.array->y[span.end] = iy;
+ span.end++;
+ }
+ }
+ assert(span.end <= MAX_WIDTH);
+ _swrast_write_rgba_span(ctx, &span);
+ }
+}
-/*
- * Distance attenuated, antialiased points with or without texture mapping.
+/**
+ * Draw size=1, single-pixel point
*/
-#define FLAGS (RGBA | ATTENUATE | ATTRIBS | SMOOTH)
-#define NAME atten_antialiased_rgba_point
-#include "s_pointtemp.h"
+static void
+pixel_point(GLcontext *ctx, const SWvertex *vert)
+{
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ const GLboolean ciMode = !ctx->Visual.rgbMode;
+ /*
+ * Note that unlike the other functions, we put single-pixel points
+ * into a special span array in order to render as many points as
+ * possible with a single _swrast_write_rgba_span() call.
+ */
+ SWspan *span = &(swrast->PointSpan);
+ GLuint count;
+
+ CULL_INVALID(vert);
+
+ /* Span init */
+ span->interpMask = 0;
+ span->arrayMask = SPAN_XY | SPAN_Z;
+ if (ciMode)
+ span->arrayMask |= SPAN_INDEX;
+ else
+ span->arrayMask |= SPAN_RGBA;
+ /*span->arrayMask |= SPAN_LAMBDA;*/
+ span->arrayAttribs = swrast->_ActiveAttribMask; /* we'll produce these vals */
+
+ /* need these for fragment programs */
+ span->attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F;
+ span->attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0F;
+ span->attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0F;
+
+ /* check if we need to flush */
+ if (span->end >= MAX_WIDTH ||
+ (swrast->_RasterMask & (BLEND_BIT | LOGIC_OP_BIT | MASKING_BIT))) {
+ if (ciMode)
+ _swrast_write_index_span(ctx, span);
+ else
+ _swrast_write_rgba_span(ctx, span);
+ span->end = 0;
+ }
+ count = span->end;
-/*
- * Sprite (textured point)
- */
-#define FLAGS (RGBA | SPRITE | SPECULAR)
-#define NAME sprite_point
-#include "s_pointtemp.h"
+ /* fragment attributes */
+ if (ciMode) {
+ span->array->index[count] = (GLuint) vert->attrib[FRAG_ATTRIB_CI][0];
+ }
+ else {
+ span->array->rgba[count][RCOMP] = vert->color[0];
+ span->array->rgba[count][GCOMP] = vert->color[1];
+ span->array->rgba[count][BCOMP] = vert->color[2];
+ span->array->rgba[count][ACOMP] = vert->color[3];
+ }
+ ATTRIB_LOOP_BEGIN
+ COPY_4V(span->array->attribs[attr][count], vert->attrib[attr]);
+ ATTRIB_LOOP_END
+ /* fragment position */
+ span->array->x[count] = (GLint) vert->attrib[FRAG_ATTRIB_WPOS][0];
+ span->array->y[count] = (GLint) vert->attrib[FRAG_ATTRIB_WPOS][1];
+ span->array->z[count] = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F);
-#define FLAGS (RGBA | SPRITE | SPECULAR | ATTENUATE)
-#define NAME atten_sprite_point
-#include "s_pointtemp.h"
+ span->end = count + 1;
+ ASSERT(span->end <= MAX_WIDTH);
+}
+/**
+ * Add specular color to primary color, draw point, restore original
+ * primary color.
+ */
void
_swrast_add_spec_terms_point(GLcontext *ctx, const SWvertex *v0)
{
- SWvertex *ncv0 = (SWvertex *) v0;
+ SWvertex *ncv0 = (SWvertex *) v0; /* cast away const */
GLfloat rSum, gSum, bSum;
GLchan cSave[4];
/* save */
- COPY_CHAN4( cSave, ncv0->color );
+ COPY_CHAN4(cSave, ncv0->color);
/* sum */
rSum = CHAN_TO_FLOAT(ncv0->color[0]) + ncv0->attrib[FRAG_ATTRIB_COL1][0];
gSum = CHAN_TO_FLOAT(ncv0->color[1]) + ncv0->attrib[FRAG_ATTRIB_COL1][1];
@@ -176,115 +535,35 @@ _swrast_add_spec_terms_point(GLcontext *ctx, const SWvertex *v0)
}
-
-/* record the current point function name */
-#ifdef DEBUG
-
-static const char *pntFuncName = NULL;
-
-#define USE(pntFunc) \
-do { \
- pntFuncName = #pntFunc; \
- /*printf("%s\n", pntFuncName);*/ \
- swrast->Point = pntFunc; \
-} while (0)
-
-#else
-
-#define USE(pntFunc) swrast->Point = pntFunc
-
-#endif
-
-
-/*
- * Examine the current context to determine which point drawing function
- * should be used.
+/**
+ * Examine current state to determine which point drawing function to use.
*/
void
-_swrast_choose_point( GLcontext *ctx )
+_swrast_choose_point(GLcontext *ctx)
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLboolean rgbMode = ctx->Visual.rgbMode;
- GLboolean specular = (ctx->Fog.ColorSumEnabled ||
- (ctx->Light.Enabled &&
- ctx->Light.Model.ColorControl == GL_SEPARATE_SPECULAR_COLOR));
- if (ctx->RenderMode==GL_RENDER) {
+ if (ctx->RenderMode == GL_RENDER) {
if (ctx->Point.PointSprite) {
- /* GL_ARB_point_sprite / GL_NV_point_sprite */
- /* XXX this might not be good enough */
- if (ctx->Point._Attenuated)
- USE(atten_sprite_point);
- else
- USE(sprite_point);
+ swrast->Point = sprite_point;
}
else if (ctx->Point.SmoothFlag) {
- /* Smooth points */
- if (rgbMode) {
- if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled) {
- USE(atten_antialiased_rgba_point);
- }
- else if (ctx->Texture._EnabledCoordUnits) {
- USE(antialiased_tex_rgba_point);
- }
- else {
- USE(antialiased_rgba_point);
- }
- }
- else {
- USE(antialiased_ci_point);
- }
+ swrast->Point = smooth_point;
}
- else if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled) {
- if (rgbMode) {
- if (ctx->Texture._EnabledCoordUnits) {
- if (ctx->Point.SmoothFlag) {
- USE(atten_antialiased_rgba_point);
- }
- else {
- USE(atten_textured_rgba_point);
- }
- }
- else {
- USE(atten_general_rgba_point);
- }
- }
- else {
- /* ci, atten */
- USE(atten_general_ci_point);
- }
- }
- else if ((ctx->Texture._EnabledCoordUnits
- || specular
- || swrast->_FogEnabled) && rgbMode) {
- /* textured, fogged */
- USE(textured_rgba_point);
- }
- else if (ctx->Point._Size != 1.0) {
- /* large points */
- if (rgbMode) {
- USE(general_rgba_point);
- }
- else {
- USE(general_ci_point);
- }
+ else if (ctx->Point._Size > 1.0 ||
+ ctx->Point._Attenuated ||
+ ctx->VertexProgram.PointSizeEnabled) {
+ swrast->Point = large_point;
}
else {
- /* single pixel points */
- if (rgbMode) {
- assert((swrast->_ActiveAttribMask & FRAG_BIT_COL1) == 0);
- USE(size1_rgba_point);
- }
- else {
- USE(size1_ci_point);
- }
+ swrast->Point = pixel_point;
}
}
- else if (ctx->RenderMode==GL_FEEDBACK) {
- USE(_swrast_feedback_point);
+ else if (ctx->RenderMode == GL_FEEDBACK) {
+ swrast->Point = _swrast_feedback_point;
}
else {
/* GL_SELECT mode */
- USE(_swrast_select_point);
+ swrast->Point = _swrast_select_point;
}
}
diff --git a/src/mesa/swrast/s_pointtemp.h b/src/mesa/swrast/s_pointtemp.h
deleted file mode 100644
index 206085b5b8..0000000000
--- a/src/mesa/swrast/s_pointtemp.h
+++ /dev/null
@@ -1,406 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.5.3
- *
- * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * Regarding GL_NV_point_sprite:
- *
- * Portions of this software may use or implement intellectual
- * property owned and licensed by NVIDIA Corporation. NVIDIA disclaims
- * any and all warranties with respect to such intellectual property,
- * including any use thereof or modifications thereto.
- */
-
-
-/*
- * Point rendering template code.
- *
- * Set FLAGS = bitwise-OR of the following tokens:
- *
- * RGBA = do rgba instead of color index
- * SMOOTH = do antialiasing
- * ATTRIBS = general attributes (texcoords, etc)
- * LARGE = do points with diameter > 1 pixel
- * ATTENUATE = compute point size attenuation
- * SPRITE = GL_ARB_point_sprite / GL_NV_point_sprite
- *
- * Notes: LARGE and ATTENUATE are exclusive of each other.
- * ATTRIBS requires RGBA
- */
-
-
-/*
- * NOTES on antialiased point rasterization:
- *
- * Let d = distance of fragment center from vertex.
- * if d < rmin2 then
- * fragment has 100% coverage
- * else if d > rmax2 then
- * fragment has 0% coverage
- * else
- * fragment has % coverage = (d - rmin2) / (rmax2 - rmin2)
- */
-
-
-static void
-NAME ( GLcontext *ctx, const SWvertex *vert )
-{
-#if FLAGS & (ATTENUATE | LARGE | SMOOTH | SPRITE)
- GLfloat size;
-#endif
-#if FLAGS & RGBA
-#if (FLAGS & ATTENUATE) && (FLAGS & SMOOTH)
- GLfloat alphaAtten;
-#endif
- const GLchan red = vert->color[0];
- const GLchan green = vert->color[1];
- const GLchan blue = vert->color[2];
- const GLchan alpha = vert->color[3];
-#endif
-#if FLAGS & INDEX
- const GLuint colorIndex = (GLuint) vert->attrib[FRAG_ATTRIB_CI][0]; /* XXX round? */
-#endif
-#if FLAGS & ATTRIBS
- GLfloat attrib[FRAG_ATTRIB_MAX][4]; /* texture & varying */
-#endif
- SWcontext *swrast = SWRAST_CONTEXT(ctx);
- SWspan *span = &(swrast->PointSpan);
-
- /*
- printf("%s %g %g %g %g\n", __FUNCTION__,
- vert->attrib[FRAG_ATTRIB_COL1][0],
- vert->attrib[FRAG_ATTRIB_COL1][1],
- vert->attrib[FRAG_ATTRIB_COL1][2],
- vert->attrib[FRAG_ATTRIB_COL1][3]);
- if ( vert->attrib[FRAG_ATTRIB_COL1][0] == 0.0 &&
- vert->attrib[FRAG_ATTRIB_COL1][1] == 1.0 &&
- vert->attrib[FRAG_ATTRIB_COL1][2] == 0.0)
- foo();
- */
-
- /* Cull primitives with malformed coordinates.
- */
- {
- float tmp = vert->attrib[FRAG_ATTRIB_WPOS][0] + vert->attrib[FRAG_ATTRIB_WPOS][1];
- if (IS_INF_OR_NAN(tmp))
- return;
- }
-
- /*
- * Span init
- */
- span->interpMask = 0;
- span->arrayMask = SPAN_XY | SPAN_Z;
-#if FLAGS & RGBA
- span->arrayMask |= SPAN_RGBA;
-#endif
-#if FLAGS & INDEX
- span->arrayMask |= SPAN_INDEX;
-#endif
-#if FLAGS & ATTRIBS
- span->arrayMask |= SPAN_LAMBDA;
-
- /* we're filling in the attrib arrays: */
- span->arrayAttribs = swrast->_ActiveAttribMask;
-
- ATTRIB_LOOP_BEGIN
- COPY_4V(attrib[attr], vert->attrib[attr]);
- ATTRIB_LOOP_END
-
- /* need these for fragment programs */
- span->attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F;
- span->attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0F;
- span->attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0F;
-#else
- assert((swrast->_ActiveAttribMask & FRAG_BIT_COL1) == 0);
-#endif
-
-#if FLAGS & SMOOTH
- span->arrayMask |= SPAN_COVERAGE;
-#endif
-#if FLAGS & SPRITE
- span->arrayMask |= SPAN_LAMBDA;
-#endif
-
- /* Compute point size if not known to be one */
-#if FLAGS & ATTENUATE
- /* first, clamp attenuated size to the user-specifed range */
- size = CLAMP(vert->pointSize, ctx->Point.MinSize, ctx->Point.MaxSize);
-#if (FLAGS & RGBA) && (FLAGS & SMOOTH)
- /* only if multisampling, compute the fade factor */
- if (ctx->Multisample.Enabled) {
- if (vert->pointSize >= ctx->Point.Threshold) {
- alphaAtten = 1.0F;
- }
- else {
- GLfloat dsize = vert->pointSize / ctx->Point.Threshold;
- alphaAtten = dsize * dsize;
- }
- }
- else {
- alphaAtten = 1.0;
- }
-#endif
-#elif FLAGS & (LARGE | SMOOTH | SPRITE)
- /* constant, non-attenuated size */
- size = ctx->Point._Size; /* this is already clamped */
-#endif
-
-
-#if FLAGS & (ATTENUATE | LARGE | SMOOTH | SPRITE)
- /***
- *** Multi-pixel points
- ***/
-
- /* do final clamping now */
- if (ctx->Point.SmoothFlag) {
- size = CLAMP(size, ctx->Const.MinPointSizeAA, ctx->Const.MaxPointSizeAA);
- }
- else {
- size = CLAMP(size, ctx->Const.MinPointSize, ctx->Const.MaxPointSize);
- }
-
- {{
- GLint x, y;
- const GLfloat radius = 0.5F * size;
- const GLuint z = (GLuint) (vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F);
- GLuint count;
-#if FLAGS & SMOOTH
- const GLfloat rmin = radius - 0.7071F; /* 0.7071 = sqrt(2)/2 */
- const GLfloat rmax = radius + 0.7071F;
- const GLfloat rmin2 = MAX2(0.0F, rmin * rmin);
- const GLfloat rmax2 = rmax * rmax;
- const GLfloat cscale = 1.0F / (rmax2 - rmin2);
- const GLint xmin = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][0] - radius);
- const GLint xmax = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][0] + radius);
- const GLint ymin = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][1] - radius);
- const GLint ymax = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][1] + radius);
-#else
- /* non-smooth */
- GLint xmin, xmax, ymin, ymax;
- GLint iSize = (GLint) (size + 0.5F);
- GLint iRadius;
- iSize = MAX2(1, iSize);
- iRadius = iSize / 2;
- if (iSize & 1) {
- /* odd size */
- xmin = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][0] - iRadius);
- xmax = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][0] + iRadius);
- ymin = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][1] - iRadius);
- ymax = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][1] + iRadius);
- }
- else {
- /* even size */
- xmin = (GLint) vert->attrib[FRAG_ATTRIB_WPOS][0] - iRadius + 1;
- xmax = xmin + iSize - 1;
- ymin = (GLint) vert->attrib[FRAG_ATTRIB_WPOS][1] - iRadius + 1;
- ymax = ymin + iSize - 1;
- }
-#endif /*SMOOTH*/
-
- /* check if we need to flush */
- if (span->end + (xmax-xmin+1) * (ymax-ymin+1) >= MAX_WIDTH ||
- (swrast->_RasterMask & (BLEND_BIT | LOGIC_OP_BIT | MASKING_BIT))) {
- if (span->end > 0) {
-#if FLAGS & RGBA
- _swrast_write_rgba_span(ctx, span);
-#else
- _swrast_write_index_span(ctx, span);
-#endif
- span->end = 0;
- }
- }
-
- /*
- * OK, generate fragments
- */
- count = span->end;
- (void) radius;
- for (y = ymin; y <= ymax; y++) {
- /* check if we need to flush */
- if (count + (xmax-xmin+1) >= MAX_WIDTH) {
- span->end = count;
-#if FLAGS & RGBA
- _swrast_write_rgba_span(ctx, span);
-#else
- _swrast_write_index_span(ctx, span);
-#endif
- count = span->end = 0;
- }
- for (x = xmin; x <= xmax; x++) {
-#if FLAGS & SPRITE
- GLuint u;
-#endif
-
-#if FLAGS & RGBA
- span->array->rgba[count][RCOMP] = red;
- span->array->rgba[count][GCOMP] = green;
- span->array->rgba[count][BCOMP] = blue;
- span->array->rgba[count][ACOMP] = alpha;
-#endif
-#if FLAGS & INDEX
- span->array->index[count] = colorIndex;
-#endif
-#if FLAGS & ATTRIBS
- ATTRIB_LOOP_BEGIN
- COPY_4V(span->array->attribs[attr][count], attrib[attr]);
- /**
- if (attr < FRAG_ATTRIB_VAR0) {
- const GLuint u = attr - FRAG_ATTRIB_TEX0;
- span->array->lambda[u][count] = 0.0;
- }
- **/
- ATTRIB_LOOP_END
-#endif
-
-#if FLAGS & SMOOTH
- /* compute coverage */
- {
- const GLfloat dx = x - vert->attrib[FRAG_ATTRIB_WPOS][0] + 0.5F;
- const GLfloat dy = y - vert->attrib[FRAG_ATTRIB_WPOS][1] + 0.5F;
- const GLfloat dist2 = dx * dx + dy * dy;
- if (dist2 < rmax2) {
- if (dist2 >= rmin2) {
- /* compute partial coverage */
- span->array->coverage[count] = 1.0F - (dist2 - rmin2) * cscale;
-#if FLAGS & INDEX
- /* coverage in [0,15] */
- span->array->coverage[count] *= 15.0;
-#endif
- }
- else {
- /* full coverage */
- span->array->coverage[count] = 1.0F;
- }
-
- span->array->x[count] = x;
- span->array->y[count] = y;
- span->array->z[count] = z;
-
-#if (FLAGS & ATTENUATE) && (FLAGS & RGBA)
- span->array->rgba[count][ACOMP] = (GLchan) (alpha * alphaAtten);
-#elif FLAGS & RGBA
- span->array->rgba[count][ACOMP] = alpha;
-#endif /*ATTENUATE*/
- count++;
- } /*if*/
- }
-
-#else /*SMOOTH*/
-
- /* not smooth (square points) */
- span->array->x[count] = x;
- span->array->y[count] = y;
- span->array->z[count] = z;
-
-#if FLAGS & SPRITE
- for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
- GLuint attr = FRAG_ATTRIB_TEX0 + u;
- if (ctx->Texture.Unit[u]._ReallyEnabled) {
- if (ctx->Point.CoordReplace[u]) {
- GLfloat s = 0.5F + (x + 0.5F - vert->attrib[FRAG_ATTRIB_WPOS][0]) / size;
- GLfloat t, r;
- if (ctx->Point.SpriteOrigin == GL_LOWER_LEFT)
- t = 0.5F + (y + 0.5F - vert->attrib[FRAG_ATTRIB_WPOS][1]) / size;
- else /* GL_UPPER_LEFT */
- t = 0.5F - (y + 0.5F - vert->attrib[FRAG_ATTRIB_WPOS][1]) / size;
- if (ctx->Point.SpriteRMode == GL_ZERO)
- r = 0.0F;
- else if (ctx->Point.SpriteRMode == GL_S)
- r = vert->attrib[attr][0];
- else /* GL_R */
- r = vert->attrib[attr][2];
- span->array->attribs[attr][count][0] = s;
- span->array->attribs[attr][count][1] = t;
- span->array->attribs[attr][count][2] = r;
- span->array->attribs[attr][count][3] = 1.0F;
- span->array->lambda[u][count] = 0.0; /* XXX fix? */
- }
- else {
- COPY_4V(span->array->attribs[attr][count],
- vert->attrib[attr]);
- }
- }
- }
-#endif /*SPRITE*/
-
- count++; /* square point */
-
-#endif /*SMOOTH*/
-
- } /*for x*/
- } /*for y*/
- span->end = count;
- }}
-
-#else /* LARGE | ATTENUATE | SMOOTH | SPRITE */
-
- /***
- *** Single-pixel points
- ***/
- {{
- GLuint count;
-
- /* check if we need to flush */
- if (span->end >= MAX_WIDTH ||
- (swrast->_RasterMask & (BLEND_BIT | LOGIC_OP_BIT | MASKING_BIT))) {
-#if FLAGS & RGBA
- _swrast_write_rgba_span(ctx, span);
-#else
- _swrast_write_index_span(ctx, span);
-#endif
- span->end = 0;
- }
-
- count = span->end;
-
-#if FLAGS & RGBA
- span->array->rgba[count][RCOMP] = red;
- span->array->rgba[count][GCOMP] = green;
- span->array->rgba[count][BCOMP] = blue;
- span->array->rgba[count][ACOMP] = alpha;
-#endif
-#if FLAGS & INDEX
- span->array->index[count] = colorIndex;
-#endif
-#if FLAGS & ATTRIBS
- ATTRIB_LOOP_BEGIN
- COPY_4V(span->array->attribs[attr][count], attribs[attr]);
- ATTRIB_LOOP_END
-#endif
-
- span->array->x[count] = (GLint) vert->attrib[FRAG_ATTRIB_WPOS][0];
- span->array->y[count] = (GLint) vert->attrib[FRAG_ATTRIB_WPOS][1];
- span->array->z[count] = (GLint) (vert->attrib[FRAG_ATTRIB_WPOS][2] + 0.5F);
-
- span->end = count + 1;
- }}
-
-#endif /* LARGE || ATTENUATE || SMOOTH */
-
- ASSERT(span->end <= MAX_WIDTH);
-}
-
-
-#undef FLAGS
-#undef NAME
diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c
index 90a3d5545f..f23272c2be 100644
--- a/src/mesa/swrast/s_span.c
+++ b/src/mesa/swrast/s_span.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.3
+ * Version: 7.1
*
* Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
*
@@ -171,6 +171,12 @@ interpolate_active_attribs(GLcontext *ctx, SWspan *span, GLbitfield attrMask)
{
const SWcontext *swrast = SWRAST_CONTEXT(ctx);
+ /*
+ * Don't overwrite existing array values, such as colors that may have
+ * been produced by glDraw/CopyPixels.
+ */
+ attrMask &= ~span->arrayAttribs;
+
ATTRIB_LOOP_BEGIN
if (attrMask & (1 << attr)) {
const GLfloat dwdx = span->attrStepX[FRAG_ATTRIB_WPOS][3];
@@ -196,6 +202,7 @@ interpolate_active_attribs(GLcontext *ctx, SWspan *span, GLbitfield attrMask)
v3 += dv3dx;
w += dwdx;
}
+ ASSERT((span->arrayAttribs & (1 << attr)) == 0);
span->arrayAttribs |= (1 << attr);
}
ATTRIB_LOOP_END
@@ -1145,6 +1152,7 @@ convert_color_type(SWspan *span, GLenum newType, GLuint output)
span->end, span->array->mask);
span->array->ChanType = newType;
+ span->array->rgba = dst;
}
@@ -1169,10 +1177,15 @@ shade_texture_span(GLcontext *ctx, SWspan *span)
if (ctx->FragmentProgram._Current ||
ctx->ATIFragmentShader._Enabled) {
/* programmable shading */
+ if (span->primitive == GL_BITMAP && span->array->ChanType != GL_FLOAT) {
+ convert_color_type(span, GL_FLOAT, 0);
+ }
+ if (span->primitive != GL_POINT) {
+ /* for points, we populated the arrays already */
+ interpolate_active_attribs(ctx, span, ~0);
+ }
span->array->ChanType = GL_FLOAT;
- interpolate_active_attribs(ctx, span, ~0);
-
if (!(span->arrayMask & SPAN_Z))
_swrast_span_interpolate_z (ctx, span);
@@ -1227,7 +1240,8 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span)
const GLbitfield origInterpMask = span->interpMask;
const GLbitfield origArrayMask = span->arrayMask;
const GLbitfield origArrayAttribs = span->arrayAttribs;
- const GLenum chanType = span->array->ChanType;
+ const GLenum origChanType = span->array->ChanType;
+ void * const origRgba = span->array->rgba;
const GLboolean shader = (ctx->FragmentProgram._Current
|| ctx->ATIFragmentShader._Enabled);
const GLboolean shaderOrTexture = shader || ctx->Texture._EnabledUnits;
@@ -1449,7 +1463,8 @@ end:
span->interpMask = origInterpMask;
span->arrayMask = origArrayMask;
span->arrayAttribs = origArrayAttribs;
- span->array->ChanType = chanType;
+ span->array->ChanType = origChanType;
+ span->array->rgba = origRgba;
}
diff --git a/src/mesa/swrast/s_span.h b/src/mesa/swrast/s_span.h
index 585cce91ee..512134db0f 100644
--- a/src/mesa/swrast/s_span.h
+++ b/src/mesa/swrast/s_span.h
@@ -159,15 +159,15 @@ typedef struct sw_span
-#define INIT_SPAN(S, PRIMITIVE, END, INTERP_MASK, ARRAY_MASK) \
-do { \
- (S).primitive = (PRIMITIVE); \
- (S).interpMask = (INTERP_MASK); \
- (S).arrayMask = (ARRAY_MASK); \
- (S).arrayAttribs = 0x0; \
- (S).end = (END); \
- (S).facing = 0; \
- (S).array = SWRAST_CONTEXT(ctx)->SpanArrays; \
+#define INIT_SPAN(S, PRIMITIVE) \
+do { \
+ (S).primitive = (PRIMITIVE); \
+ (S).interpMask = 0x0; \
+ (S).arrayMask = 0x0; \
+ (S).arrayAttribs = 0x0; \
+ (S).end = 0; \
+ (S).facing = 0; \
+ (S).array = SWRAST_CONTEXT(ctx)->SpanArrays; \
} while (0)
diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h
index 2a90ffd85f..f5bc03e81e 100644
--- a/src/mesa/swrast/s_tritemp.h
+++ b/src/mesa/swrast/s_tritemp.h
@@ -144,7 +144,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
(void) swrast;
- INIT_SPAN(span, GL_POLYGON, 0, 0, 0);
+ INIT_SPAN(span, GL_POLYGON);
span.y = 0; /* silence warnings */
#ifdef INTERP_Z
diff --git a/src/mesa/swrast/s_zoom.c b/src/mesa/swrast/s_zoom.c
index 78fa137d3f..9f1a4c6f0a 100644
--- a/src/mesa/swrast/s_zoom.c
+++ b/src/mesa/swrast/s_zoom.c
@@ -148,26 +148,25 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span,
ASSERT((span->arrayMask & SPAN_XY) == 0);
ASSERT(span->primitive == GL_BITMAP);
- INIT_SPAN(zoomed, GL_BITMAP, 0, 0, 0);
+ INIT_SPAN(zoomed, GL_BITMAP);
zoomed.x = x0;
zoomed.end = zoomedWidth;
zoomed.array = &zoomed_arrays;
zoomed_arrays.ChanType = span->array->ChanType;
- /* XXX temporary */
-#if CHAN_TYPE == GL_UNSIGNED_BYTE
- zoomed_arrays.rgba = zoomed_arrays.rgba8;
-#elif CHAN_TYPE == GL_UNSIGNED_SHORT
- zoomed_arrays.rgba = zoomed_arrays.rgba16;
-#else
- zoomed_arrays.rgba = zoomed_arrays.attribs[FRAG_ATTRIB_COL0];
-#endif
+ if (zoomed_arrays.ChanType == GL_UNSIGNED_BYTE)
+ zoomed_arrays.rgba = (GLchan (*)[4]) zoomed_arrays.rgba8;
+ else if (zoomed_arrays.ChanType == GL_UNSIGNED_SHORT)
+ zoomed_arrays.rgba = (GLchan (*)[4]) zoomed_arrays.rgba16;
+ else
+ zoomed_arrays.rgba = (GLchan (*)[4]) zoomed_arrays.attribs[FRAG_ATTRIB_COL0];
+ COPY_4V(zoomed.attrStart[FRAG_ATTRIB_WPOS], span->attrStart[FRAG_ATTRIB_WPOS]);
+ COPY_4V(zoomed.attrStepX[FRAG_ATTRIB_WPOS], span->attrStepX[FRAG_ATTRIB_WPOS]);
+ COPY_4V(zoomed.attrStepY[FRAG_ATTRIB_WPOS], span->attrStepY[FRAG_ATTRIB_WPOS]);
- /* copy fog interp info */
zoomed.attrStart[FRAG_ATTRIB_FOGC][0] = span->attrStart[FRAG_ATTRIB_FOGC][0];
zoomed.attrStepX[FRAG_ATTRIB_FOGC][0] = span->attrStepX[FRAG_ATTRIB_FOGC][0];
zoomed.attrStepY[FRAG_ATTRIB_FOGC][0] = span->attrStepY[FRAG_ATTRIB_FOGC][0];
- /* XXX copy texcoord info? */
if (format == GL_RGBA || format == GL_RGB) {
/* copy Z info */
@@ -176,6 +175,7 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span,
/* we'll generate an array of colorss */
zoomed.interpMask = span->interpMask & ~SPAN_RGBA;
zoomed.arrayMask |= SPAN_RGBA;
+ zoomed.arrayAttribs |= FRAG_BIT_COL0; /* we'll produce these values */
ASSERT(span->arrayMask & SPAN_RGBA);
}
else if (format == GL_COLOR_INDEX) {
diff --git a/src/mesa/swrast_setup/ss_context.c b/src/mesa/swrast_setup/ss_context.c
index cd4ac57d37..f8a1cadfa5 100644
--- a/src/mesa/swrast_setup/ss_context.c
+++ b/src/mesa/swrast_setup/ss_context.c
@@ -125,6 +125,7 @@ setup_vertex_format(GLcontext *ctx)
if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR0 )) {
swsetup->intColors = !ctx->FragmentProgram._Current
&& !ctx->ATIFragmentShader._Enabled
+ && ctx->RenderMode == GL_RENDER
&& CHAN_TYPE == GL_UNSIGNED_BYTE;
if (swsetup->intColors)
EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4CHAN_4F_RGBA, color );
@@ -287,13 +288,11 @@ _swsetup_Translate( GLcontext *ctx, const void *vertex, SWvertex *dest )
dest->attrib[FRAG_ATTRIB_VAR0 + i] );
_tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR0, tmp );
+ /* XXX need float color FRAG_ATTRIB_COL0?? */
UNCLAMPED_FLOAT_TO_RGBA_CHAN( dest->color, tmp );
_tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR1, tmp );
COPY_4V(dest->attrib[FRAG_ATTRIB_COL1], tmp);
- /*
- UNCLAMPED_FLOAT_TO_RGBA_CHAN( dest->specular, tmp );
- */
_tnl_get_attr( ctx, vertex, _TNL_ATTRIB_FOG, tmp );
dest->attrib[FRAG_ATTRIB_FOGC][0] = tmp[0];
diff --git a/src/mesa/tnl/t_save_api.c b/src/mesa/tnl/t_save_api.c
deleted file mode 100644
index b08f05374e..0000000000
--- a/src/mesa/tnl/t_save_api.c
+++ /dev/null
@@ -1,1834 +0,0 @@
-/**************************************************************************
-
-Copyright 2002 Tungsten Graphics Inc., Cedar Park, Texas.
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-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
-TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Keith Whitwell <keith@tungstengraphics.com>
- */
-
-
-
-/**
- * The display list compiler attempts to store lists of vertices with the
- * same vertex layout. Additionally it attempts to minimize the need
- * for execute-time fixup of these vertex lists, allowing them to be
- * cached on hardware.
- *
- * There are still some circumstances where this can be thwarted, for
- * example by building a list that consists of one very long primitive
- * (eg Begin(Triangles), 1000 vertices, End), and calling that list
- * from inside a different begin/end object (Begin(Lines), CallList,
- * End).
- *
- * In that case the code will have to replay the list as individual
- * commands through the Exec dispatch table, or fix up the copied
- * vertices at execute-time.
- *
- * The other case where fixup is required is when a vertex attribute
- * is introduced in the middle of a primitive. Eg:
- * Begin(Lines)
- * TexCoord1f() Vertex2f()
- * TexCoord1f() Color3f() Vertex2f()
- * End()
- *
- * If the current value of Color isn't known at compile-time, this
- * primitive will require fixup.
- *
- *
- * The list compiler currently doesn't attempt to compile lists
- * containing EvalCoord or EvalPoint commands. On encountering one of
- * these, compilation falls back to opcodes.
- *
- * This could be improved to fallback only when a mix of EvalCoord and
- * Vertex commands are issued within a single primitive.
- */
-
-
-#include "glheader.h"
-#include "context.h"
-#include "dlist.h"
-#include "enums.h"
-#include "macros.h"
-#include "api_validate.h"
-#include "api_arrayelt.h"
-#include "vtxfmt.h"
-#include "t_save_api.h"
-#include "dispatch.h"
-
-/*
- * NOTE: Old 'parity' issue is gone, but copying can still be
- * wrong-footed on replay.
- */
-static GLuint _save_copy_vertices( GLcontext *ctx,
- const struct tnl_vertex_list *node )
-{
- TNLcontext *tnl = TNL_CONTEXT( ctx );
- const struct tnl_prim *prim = &node->prim[node->prim_count-1];
- GLuint nr = prim->count;
- GLuint sz = tnl->save.vertex_size;
- const GLfloat *src = node->buffer + prim->start * sz;
- GLfloat *dst = tnl->save.copied.buffer;
- GLuint ovf, i;
-
- if (prim->mode & PRIM_END)
- return 0;
-
- switch( prim->mode & PRIM_MODE_MASK )
- {
- case GL_POINTS:
- return 0;
- 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) );
- 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) );
- 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) );
- return i;
- case GL_LINE_STRIP:
- if (nr == 0)
- return 0;
- else {
- _mesa_memcpy( dst, src+(nr-1)*sz, sz*sizeof(GLfloat) );
- return 1;
- }
- case GL_LINE_LOOP:
- case GL_TRIANGLE_FAN:
- case GL_POLYGON:
- if (nr == 0)
- return 0;
- else if (nr == 1) {
- _mesa_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) );
- return 2;
- }
- case GL_TRIANGLE_STRIP:
- case GL_QUAD_STRIP:
- switch (nr) {
- case 0: ovf = 0; break;
- case 1: ovf = 1; break;
- 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) );
- return i;
- default:
- assert(0);
- return 0;
- }
-}
-
-
-static void
-build_normal_lengths( struct tnl_vertex_list *node )
-{
- GLuint i;
- GLfloat *len;
- GLfloat *n = node->buffer;
- GLuint stride = node->vertex_size;
- GLuint count = node->count;
-
- len = node->normal_lengths = (GLfloat *) MALLOC( count * sizeof(GLfloat) );
- if (!len)
- return;
-
- /* Find the normal of the first vertex:
- */
- for (i = 0 ; i < _TNL_ATTRIB_NORMAL ; i++)
- n += node->attrsz[i];
-
- for (i = 0 ; i < count ; i++, n += stride) {
- len[i] = LEN_3FV( n );
- if (len[i] > 0.0F) len[i] = 1.0F / len[i];
- }
-}
-
-static struct tnl_vertex_store *alloc_vertex_store( GLcontext *ctx )
-{
- struct tnl_vertex_store *store = MALLOC_STRUCT(tnl_vertex_store);
- (void) ctx;
- store->used = 0;
- store->refcount = 1;
- return store;
-}
-
-static struct tnl_primitive_store *alloc_prim_store( GLcontext *ctx )
-{
- struct tnl_primitive_store *store = MALLOC_STRUCT(tnl_primitive_store);
- (void) ctx;
- store->used = 0;
- store->refcount = 1;
- return store;
-}
-
-static void _save_reset_counters( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
-
- tnl->save.prim = tnl->save.prim_store->buffer + tnl->save.prim_store->used;
- tnl->save.buffer = (tnl->save.vertex_store->buffer +
- tnl->save.vertex_store->used);
-
- if (tnl->save.vertex_size)
- tnl->save.initial_counter = ((SAVE_BUFFER_SIZE -
- tnl->save.vertex_store->used) /
- tnl->save.vertex_size);
- else
- tnl->save.initial_counter = 0;
-
- if (tnl->save.initial_counter > ctx->Const.MaxArrayLockSize )
- tnl->save.initial_counter = ctx->Const.MaxArrayLockSize;
-
- tnl->save.counter = tnl->save.initial_counter;
- tnl->save.prim_count = 0;
- tnl->save.prim_max = SAVE_PRIM_SIZE - tnl->save.prim_store->used;
- tnl->save.copied.nr = 0;
- tnl->save.dangling_attr_ref = 0;
-}
-
-
-/* Insert the active immediate struct onto the display list currently
- * being built.
- */
-static void _save_compile_vertex_list( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct tnl_vertex_list *node;
-
- /* Allocate space for this structure in the display list currently
- * being compiled.
- */
- node = (struct tnl_vertex_list *)
- _mesa_alloc_instruction(ctx, tnl->save.opcode_vertex_list, sizeof(*node));
-
- if (!node)
- return;
-
- /* Duplicate our template, increment refcounts to the storage structs:
- */
- _mesa_memcpy(node->attrsz, tnl->save.attrsz, sizeof(node->attrsz));
- node->vertex_size = tnl->save.vertex_size;
- node->buffer = tnl->save.buffer;
- node->count = tnl->save.initial_counter - tnl->save.counter;
- node->wrap_count = tnl->save.copied.nr;
- node->have_materials = tnl->save.have_materials;
- node->dangling_attr_ref = tnl->save.dangling_attr_ref;
- node->normal_lengths = NULL;
- node->prim = tnl->save.prim;
- node->prim_count = tnl->save.prim_count;
- node->vertex_store = tnl->save.vertex_store;
- node->prim_store = tnl->save.prim_store;
-
- node->vertex_store->refcount++;
- node->prim_store->refcount++;
-
- assert(node->attrsz[_TNL_ATTRIB_POS] != 0 ||
- node->count == 0);
-
- if (tnl->save.dangling_attr_ref)
- ctx->ListState.CurrentList->flags |= MESA_DLIST_DANGLING_REFS;
-
- /* Maybe calculate normal lengths:
- */
- if (tnl->CalcDListNormalLengths &&
- node->attrsz[_TNL_ATTRIB_NORMAL] == 3 &&
- !(ctx->ListState.CurrentList->flags & MESA_DLIST_DANGLING_REFS))
- build_normal_lengths( node );
-
-
- tnl->save.vertex_store->used += tnl->save.vertex_size * node->count;
- tnl->save.prim_store->used += node->prim_count;
-
- /* Decide whether the storage structs are full, or can be used for
- * the next vertex lists as well.
- */
- if (tnl->save.vertex_store->used >
- SAVE_BUFFER_SIZE - 16 * (tnl->save.vertex_size + 4)) {
-
- tnl->save.vertex_store->refcount--;
- assert(tnl->save.vertex_store->refcount != 0);
- tnl->save.vertex_store = alloc_vertex_store( ctx );
- tnl->save.vbptr = tnl->save.vertex_store->buffer;
- }
-
- if (tnl->save.prim_store->used > SAVE_PRIM_SIZE - 6) {
- tnl->save.prim_store->refcount--;
- assert(tnl->save.prim_store->refcount != 0);
- tnl->save.prim_store = alloc_prim_store( ctx );
- }
-
- /* Reset our structures for the next run of vertices:
- */
- _save_reset_counters( ctx );
-
- /* Copy duplicated vertices
- */
- tnl->save.copied.nr = _save_copy_vertices( ctx, node );
-
-
- /* Deal with GL_COMPILE_AND_EXECUTE:
- */
- if (ctx->ExecuteFlag) {
- _tnl_playback_vertex_list( ctx, (void *) node );
- }
-}
-
-
-/* TODO -- If no new vertices have been stored, don't bother saving
- * it.
- */
-static void _save_wrap_buffers( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLint i = tnl->save.prim_count - 1;
- GLenum mode;
-
- assert(i < (GLint) tnl->save.prim_max);
- assert(i >= 0);
-
- /* Close off in-progress primitive.
- */
- tnl->save.prim[i].count = ((tnl->save.initial_counter - tnl->save.counter) -
- tnl->save.prim[i].start);
- mode = tnl->save.prim[i].mode & ~(PRIM_BEGIN|PRIM_END);
-
- /* store the copied vertices, and allocate a new list.
- */
- _save_compile_vertex_list( ctx );
-
- /* Restart interrupted primitive
- */
- tnl->save.prim[0].mode = mode;
- tnl->save.prim[0].start = 0;
- tnl->save.prim[0].count = 0;
- tnl->save.prim_count = 1;
-}
-
-
-
-/* Called only when buffers are wrapped as the result of filling the
- * vertex_store struct.
- */
-static void _save_wrap_filled_vertex( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLfloat *data = tnl->save.copied.buffer;
- GLuint i;
-
- /* Emit a glEnd to close off the last vertex list.
- */
- _save_wrap_buffers( ctx );
-
- /* Copy stored stored vertices to start of new list.
- */
- assert(tnl->save.counter > tnl->save.copied.nr);
-
- for (i = 0 ; i < tnl->save.copied.nr ; i++) {
- _mesa_memcpy( tnl->save.vbptr, data, tnl->save.vertex_size * sizeof(GLfloat));
- data += tnl->save.vertex_size;
- tnl->save.vbptr += tnl->save.vertex_size;
- tnl->save.counter--;
- }
-}
-
-
-static void _save_copy_to_current( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint i;
-
- /* XXX Use _TNL_FIRST_* and _TNL_LAST_* values instead? */
- for (i = _TNL_ATTRIB_POS+1 ; i <= _TNL_ATTRIB_EDGEFLAG ; i++) {
- if (tnl->save.attrsz[i]) {
- tnl->save.currentsz[i][0] = tnl->save.attrsz[i];
- COPY_CLEAN_4V(tnl->save.current[i],
- tnl->save.attrsz[i],
- tnl->save.attrptr[i]);
- }
- }
-
- /* Edgeflag requires special treatment:
- *
- * TODO: change edgeflag to GLfloat in Mesa.
- */
- if (tnl->save.attrsz[_TNL_ATTRIB_EDGEFLAG]) {
- ctx->ListState.ActiveEdgeFlag = 1;
- tnl->save.CurrentFloatEdgeFlag =
- tnl->save.attrptr[_TNL_ATTRIB_EDGEFLAG][0];
- ctx->ListState.CurrentEdgeFlag =
- (tnl->save.CurrentFloatEdgeFlag == 1.0);
- }
-}
-
-
-static void _save_copy_from_current( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLint i;
-
- for (i = _TNL_ATTRIB_POS+1 ; i <= _TNL_ATTRIB_EDGEFLAG ; i++)
- switch (tnl->save.attrsz[i]) {
- case 4: tnl->save.attrptr[i][3] = tnl->save.current[i][3];
- case 3: tnl->save.attrptr[i][2] = tnl->save.current[i][2];
- case 2: tnl->save.attrptr[i][1] = tnl->save.current[i][1];
- case 1: tnl->save.attrptr[i][0] = tnl->save.current[i][0];
- case 0: break;
- }
-
- /* Edgeflag requires special treatment:
- */
- if (tnl->save.attrsz[_TNL_ATTRIB_EDGEFLAG]) {
- tnl->save.CurrentFloatEdgeFlag = (GLfloat)ctx->ListState.CurrentEdgeFlag;
- tnl->save.attrptr[_TNL_ATTRIB_EDGEFLAG][0] = tnl->save.CurrentFloatEdgeFlag;
- }
-}
-
-
-
-
-/* Flush existing data, set new attrib size, replay copied vertices.
- */
-static void _save_upgrade_vertex( GLcontext *ctx,
- GLuint attr,
- GLuint newsz )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint oldsz;
- GLuint i;
- GLfloat *tmp;
-
- /* Store the current run of vertices, and emit a GL_END. Emit a
- * BEGIN in the new buffer.
- */
- if (tnl->save.initial_counter != tnl->save.counter)
- _save_wrap_buffers( ctx );
- else
- assert( tnl->save.copied.nr == 0 );
-
- /* Do a COPY_TO_CURRENT to ensure back-copying works for the case
- * when the attribute already exists in the vertex and is having
- * its size increased.
- */
- _save_copy_to_current( ctx );
-
- /* Fix up sizes:
- */
- oldsz = tnl->save.attrsz[attr];
- tnl->save.attrsz[attr] = newsz;
-
- tnl->save.vertex_size += newsz - oldsz;
- tnl->save.counter = ((SAVE_BUFFER_SIZE - tnl->save.vertex_store->used) /
- tnl->save.vertex_size);
- if (tnl->save.counter > ctx->Const.MaxArrayLockSize )
- tnl->save.counter = ctx->Const.MaxArrayLockSize;
- tnl->save.initial_counter = tnl->save.counter;
-
- /* Recalculate all the attrptr[] values:
- */
- for (i = 0, tmp = tnl->save.vertex ; i < _TNL_ATTRIB_MAX ; i++) {
- if (tnl->save.attrsz[i]) {
- tnl->save.attrptr[i] = tmp;
- tmp += tnl->save.attrsz[i];
- }
- else
- tnl->save.attrptr[i] = NULL; /* will not be dereferenced. */
- }
-
- /* Copy from current to repopulate the vertex with correct values.
- */
- _save_copy_from_current( ctx );
-
- /* Replay stored vertices to translate them to new format here.
- *
- * If there are copied vertices and the new (upgraded) attribute
- * has not been defined before, this list is somewhat degenerate,
- * and will need fixup at runtime.
- */
- if (tnl->save.copied.nr)
- {
- GLfloat *data = tnl->save.copied.buffer;
- GLfloat *dest = tnl->save.buffer;
- GLuint j;
-
- /* Need to note this and fix up at runtime (or loopback):
- */
- if (tnl->save.currentsz[attr][0] == 0) {
- assert(oldsz == 0);
- tnl->save.dangling_attr_ref = GL_TRUE;
-
-/* _mesa_debug(NULL, "_save_upgrade_vertex: dangling reference attr %d\n", */
-/* attr); */
-
-#if 0
- /* The current strategy is to punt these degenerate cases
- * through _tnl_loopback_vertex_list(), a lower-performance
- * option. To minimize the impact of this, artificially
- * reduce the size of this vertex_list.
- */
- if (t->save.counter > 10) {
- t->save.initial_counter = 10;
- t->save.counter = 10;
- }
-#endif
- }
-
- for (i = 0 ; i < tnl->save.copied.nr ; i++) {
- for (j = 0 ; j < _TNL_ATTRIB_MAX ; j++) {
- if (tnl->save.attrsz[j]) {
- if (j == attr) {
- if (oldsz) {
- COPY_CLEAN_4V( dest, oldsz, data );
- data += oldsz;
- dest += newsz;
- }
- else {
- COPY_SZ_4V( dest, newsz, tnl->save.current[attr] );
- dest += newsz;
- }
- }
- else {
- GLint sz = tnl->save.attrsz[j];
- COPY_SZ_4V( dest, sz, data );
- data += sz;
- dest += sz;
- }
- }
- }
- }
-
- tnl->save.vbptr = dest;
- tnl->save.counter -= tnl->save.copied.nr;
- }
-}
-
-
-
-
-/* Helper function for 'CHOOSE' macro. Do what's necessary when an
- * entrypoint is called for the first time.
- */
-static void do_choose( GLuint attr, GLuint sz,
- void (*attr_func)( const GLfloat *),
- void (*choose1)( const GLfloat *),
- void (*choose2)( const GLfloat *),
- void (*choose3)( const GLfloat *),
- void (*choose4)( const GLfloat *),
- const GLfloat *v )
-{
- GET_CURRENT_CONTEXT( ctx );
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- static GLfloat id[4] = { 0, 0, 0, 1 };
- int i;
-
- if (tnl->save.attrsz[attr] < sz) {
- /* New size is larger. Need to flush existing vertices and get
- * an enlarged vertex format.
- */
- _save_upgrade_vertex( ctx, attr, sz );
- }
- else {
- /* New size is equal or smaller - just need to fill in some
- * zeros.
- */
- for (i = sz ; i <= tnl->save.attrsz[attr] ; i++)
- tnl->save.attrptr[attr][i-1] = id[i-1];
- }
-
- /* Reset any active pointers for this attribute
- */
- tnl->save.tabfv[attr][0] = choose1;
- tnl->save.tabfv[attr][1] = choose2;
- tnl->save.tabfv[attr][2] = choose3;
- tnl->save.tabfv[attr][3] = choose4;
-
- /* Update the secondary dispatch table with the new function
- */
- tnl->save.tabfv[attr][sz-1] = attr_func;
-
- (*attr_func)(v);
-}
-
-
-
-/* Only one size for each attribute may be active at once. Eg. if
- * Color3f is installed/active, then Color4f may not be, even if the
- * vertex actually contains 4 color coordinates. This is because the
- * 3f version won't otherwise set color[3] to 1.0 -- this is the job
- * of the chooser function when switching between Color4f and Color3f.
- */
-#define ATTRFV( ATTR, N ) \
-static void save_choose_##ATTR##_##N( const GLfloat *v ); \
- \
-static void save_attrib_##ATTR##_##N( const GLfloat *v ) \
-{ \
- GET_CURRENT_CONTEXT( ctx ); \
- TNLcontext *tnl = TNL_CONTEXT(ctx); \
- \
- if ((ATTR) == 0) { \
- GLuint i; \
- \
- if (N>0) tnl->save.vbptr[0] = v[0]; \
- if (N>1) tnl->save.vbptr[1] = v[1]; \
- if (N>2) tnl->save.vbptr[2] = v[2]; \
- if (N>3) tnl->save.vbptr[3] = v[3]; \
- \
- for (i = N; i < tnl->save.vertex_size; i++) \
- tnl->save.vbptr[i] = tnl->save.vertex[i]; \
- \
- tnl->save.vbptr += tnl->save.vertex_size; \
- \
- if (--tnl->save.counter == 0) \
- _save_wrap_filled_vertex( ctx ); \
- } \
- else { \
- GLfloat *dest = tnl->save.attrptr[ATTR]; \
- if (N>0) dest[0] = v[0]; \
- if (N>1) dest[1] = v[1]; \
- if (N>2) dest[2] = v[2]; \
- if (N>3) dest[3] = v[3]; \
- } \
-}
-
-#define CHOOSE( ATTR, N ) \
-static void save_choose_##ATTR##_##N( const GLfloat *v ) \
-{ \
- do_choose(ATTR, N, \
- save_attrib_##ATTR##_##N, \
- save_choose_##ATTR##_1, \
- save_choose_##ATTR##_2, \
- save_choose_##ATTR##_3, \
- save_choose_##ATTR##_4, \
- v ); \
-}
-
-#define INIT(ATTR) \
-static void save_init_##ATTR( TNLcontext *tnl ) \
-{ \
- tnl->save.tabfv[ATTR][0] = save_choose_##ATTR##_1; \
- tnl->save.tabfv[ATTR][1] = save_choose_##ATTR##_2; \
- tnl->save.tabfv[ATTR][2] = save_choose_##ATTR##_3; \
- tnl->save.tabfv[ATTR][3] = save_choose_##ATTR##_4; \
-}
-
-#define ATTRS( ATTRIB ) \
- ATTRFV( ATTRIB, 1 ) \
- ATTRFV( ATTRIB, 2 ) \
- ATTRFV( ATTRIB, 3 ) \
- ATTRFV( ATTRIB, 4 ) \
- CHOOSE( ATTRIB, 1 ) \
- CHOOSE( ATTRIB, 2 ) \
- CHOOSE( ATTRIB, 3 ) \
- CHOOSE( ATTRIB, 4 ) \
- INIT( ATTRIB ) \
-
-
-/* Generate a lot of functions. These are the actual worker
- * functions, which are equivalent to those generated via codegen
- * elsewhere.
- */
-ATTRS( 0 )
-ATTRS( 1 )
-ATTRS( 2 )
-ATTRS( 3 )
-ATTRS( 4 )
-ATTRS( 5 )
-ATTRS( 6 )
-ATTRS( 7 )
-ATTRS( 8 )
-ATTRS( 9 )
-ATTRS( 10 )
-ATTRS( 11 )
-ATTRS( 12 )
-ATTRS( 13 )
-ATTRS( 14 )
-ATTRS( 15 )
-
-ATTRS( 16 )
-ATTRS( 17 )
-ATTRS( 18 )
-ATTRS( 19 )
-ATTRS( 20 )
-ATTRS( 21 )
-ATTRS( 22 )
-ATTRS( 23 )
-ATTRS( 24 )
-ATTRS( 25 )
-ATTRS( 26 )
-ATTRS( 27 )
-ATTRS( 28 )
-ATTRS( 29 )
-ATTRS( 30 )
-ATTRS( 31 )
-
-
-static void _save_reset_vertex( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLuint i;
-
- /* conventional attributes */
- save_init_0( tnl );
- save_init_1( tnl );
- save_init_2( tnl );
- save_init_3( tnl );
- save_init_4( tnl );
- save_init_5( tnl );
- save_init_6( tnl );
- save_init_7( tnl );
- save_init_8( tnl );
- save_init_9( tnl );
- save_init_10( tnl );
- save_init_11( tnl );
- save_init_12( tnl );
- save_init_13( tnl );
- save_init_14( tnl );
- save_init_15( tnl );
-
- /* generic attributes */
- save_init_16( tnl );
- save_init_17( tnl );
- save_init_18( tnl );
- save_init_19( tnl );
- save_init_20( tnl );
- save_init_21( tnl );
- save_init_22( tnl );
- save_init_23( tnl );
- save_init_24( tnl );
- save_init_25( tnl );
- save_init_26( tnl );
- save_init_27( tnl );
- save_init_28( tnl );
- save_init_29( tnl );
- save_init_30( tnl );
- save_init_31( tnl );
-
- for (i = 0 ; i < _TNL_ATTRIB_MAX ; i++)
- tnl->save.attrsz[i] = 0;
-
- tnl->save.vertex_size = 0;
- tnl->save.have_materials = 0;
-
- _save_reset_counters( ctx );
-}
-
-
-
-/* Cope with aliasing of classic Vertex, Normal, etc. and the fan-out
- * of glMultTexCoord and glProgramParamterNV by routing all these
- * through a second level dispatch table.
- */
-#define DISPATCH_ATTRFV( ATTR, COUNT, P ) \
-do { \
- GET_CURRENT_CONTEXT( ctx ); \
- TNLcontext *tnl = TNL_CONTEXT(ctx); \
- tnl->save.tabfv[ATTR][COUNT-1]( P ); \
-} while (0)
-
-#define DISPATCH_ATTR1FV( ATTR, V ) DISPATCH_ATTRFV( ATTR, 1, V )
-#define DISPATCH_ATTR2FV( ATTR, V ) DISPATCH_ATTRFV( ATTR, 2, V )
-#define DISPATCH_ATTR3FV( ATTR, V ) DISPATCH_ATTRFV( ATTR, 3, V )
-#define DISPATCH_ATTR4FV( ATTR, V ) DISPATCH_ATTRFV( ATTR, 4, V )
-
-#define DISPATCH_ATTR1F( ATTR, S ) DISPATCH_ATTRFV( ATTR, 1, &(S) )
-
-#if defined(USE_X86_ASM) && 0 /* will break register calling convention */
-/* Naughty cheat:
- */
-#define DISPATCH_ATTR2F( ATTR, S,T ) DISPATCH_ATTRFV( ATTR, 2, &(S) )
-#define DISPATCH_ATTR3F( ATTR, S,T,R ) DISPATCH_ATTRFV( ATTR, 3, &(S) )
-#define DISPATCH_ATTR4F( ATTR, S,T,R,Q ) DISPATCH_ATTRFV( ATTR, 4, &(S) )
-#else
-/* Safe:
- */
-#define DISPATCH_ATTR2F( ATTR, S,T ) \
-do { \
- GLfloat v[2]; \
- v[0] = S; v[1] = T; \
- DISPATCH_ATTR2FV( ATTR, v ); \
-} while (0)
-#define DISPATCH_ATTR3F( ATTR, S,T,R ) \
-do { \
- GLfloat v[3]; \
- v[0] = S; v[1] = T; v[2] = R; \
- DISPATCH_ATTR3FV( ATTR, v ); \
-} while (0)
-#define DISPATCH_ATTR4F( ATTR, S,T,R,Q ) \
-do { \
- GLfloat v[4]; \
- v[0] = S; v[1] = T; v[2] = R; v[3] = Q; \
- DISPATCH_ATTR4FV( ATTR, v ); \
-} while (0)
-#endif
-
-
-static void enum_error( void )
-{
- GET_CURRENT_CONTEXT( ctx );
- _mesa_compile_error( ctx, GL_INVALID_ENUM, "glVertexAttrib" );
-}
-
-static void GLAPIENTRY _save_Vertex2f( GLfloat x, GLfloat y )
-{
- DISPATCH_ATTR2F( _TNL_ATTRIB_POS, x, y );
-}
-
-static void GLAPIENTRY _save_Vertex2fv( const GLfloat *v )
-{
- DISPATCH_ATTR2FV( _TNL_ATTRIB_POS, v );
-}
-
-static void GLAPIENTRY _save_Vertex3f( GLfloat x, GLfloat y, GLfloat z )
-{
- DISPATCH_ATTR3F( _TNL_ATTRIB_POS, x, y, z );
-}
-
-static void GLAPIENTRY _save_Vertex3fv( const GLfloat *v )
-{
- DISPATCH_ATTR3FV( _TNL_ATTRIB_POS, v );
-}
-
-static void GLAPIENTRY _save_Vertex4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
-{
- DISPATCH_ATTR4F( _TNL_ATTRIB_POS, x, y, z, w );
-}
-
-static void GLAPIENTRY _save_Vertex4fv( const GLfloat *v )
-{
- DISPATCH_ATTR4FV( _TNL_ATTRIB_POS, v );
-}
-
-static void GLAPIENTRY _save_TexCoord1f( GLfloat x )
-{
- DISPATCH_ATTR1F( _TNL_ATTRIB_TEX0, x );
-}
-
-static void GLAPIENTRY _save_TexCoord1fv( const GLfloat *v )
-{
- DISPATCH_ATTR1FV( _TNL_ATTRIB_TEX0, v );
-}
-
-static void GLAPIENTRY _save_TexCoord2f( GLfloat x, GLfloat y )
-{
- DISPATCH_ATTR2F( _TNL_ATTRIB_TEX0, x, y );
-}
-
-static void GLAPIENTRY _save_TexCoord2fv( const GLfloat *v )
-{
- DISPATCH_ATTR2FV( _TNL_ATTRIB_TEX0, v );
-}
-
-static void GLAPIENTRY _save_TexCoord3f( GLfloat x, GLfloat y, GLfloat z )
-{
- DISPATCH_ATTR3F( _TNL_ATTRIB_TEX0, x, y, z );
-}
-
-static void GLAPIENTRY _save_TexCoord3fv( const GLfloat *v )
-{
- DISPATCH_ATTR3FV( _TNL_ATTRIB_TEX0, v );
-}
-
-static void GLAPIENTRY _save_TexCoord4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
-{
- DISPATCH_ATTR4F( _TNL_ATTRIB_TEX0, x, y, z, w );
-}
-
-static void GLAPIENTRY _save_TexCoord4fv( const GLfloat *v )
-{
- DISPATCH_ATTR4FV( _TNL_ATTRIB_TEX0, v );
-}
-
-static void GLAPIENTRY _save_Normal3f( GLfloat x, GLfloat y, GLfloat z )
-{
- DISPATCH_ATTR3F( _TNL_ATTRIB_NORMAL, x, y, z );
-}
-
-static void GLAPIENTRY _save_Normal3fv( const GLfloat *v )
-{
- DISPATCH_ATTR3FV( _TNL_ATTRIB_NORMAL, v );
-}
-
-static void GLAPIENTRY _save_FogCoordfEXT( GLfloat x )
-{
- DISPATCH_ATTR1F( _TNL_ATTRIB_FOG, x );
-}
-
-static void GLAPIENTRY _save_FogCoordfvEXT( const GLfloat *v )
-{
- DISPATCH_ATTR1FV( _TNL_ATTRIB_FOG, v );
-}
-
-static void GLAPIENTRY _save_Color3f( GLfloat x, GLfloat y, GLfloat z )
-{
- DISPATCH_ATTR3F( _TNL_ATTRIB_COLOR0, x, y, z );
-}
-
-static void GLAPIENTRY _save_Color3fv( const GLfloat *v )
-{
- DISPATCH_ATTR3FV( _TNL_ATTRIB_COLOR0, v );
-}
-
-static void GLAPIENTRY _save_Color4f( GLfloat x, GLfloat y, GLfloat z, GLfloat w )
-{
- DISPATCH_ATTR4F( _TNL_ATTRIB_COLOR0, x, y, z, w );
-}
-
-static void GLAPIENTRY _save_Color4fv( const GLfloat *v )
-{
- DISPATCH_ATTR4FV( _TNL_ATTRIB_COLOR0, v );
-}
-
-static void GLAPIENTRY _save_SecondaryColor3fEXT( GLfloat x, GLfloat y, GLfloat z )
-{
- DISPATCH_ATTR3F( _TNL_ATTRIB_COLOR1, x, y, z );
-}
-
-static void GLAPIENTRY _save_SecondaryColor3fvEXT( const GLfloat *v )
-{
- DISPATCH_ATTR3FV( _TNL_ATTRIB_COLOR1, v );
-}
-
-static void GLAPIENTRY _save_MultiTexCoord1f( GLenum target, GLfloat x )
-{
- GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0;
- DISPATCH_ATTR1F( attr, x );
-}
-
-static void GLAPIENTRY _save_MultiTexCoord1fv( GLenum target, const GLfloat *v )
-{
- GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0;
- DISPATCH_ATTR1FV( attr, v );
-}
-
-static void GLAPIENTRY _save_MultiTexCoord2f( GLenum target, GLfloat x, GLfloat y )
-{
- GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0;
- DISPATCH_ATTR2F( attr, x, y );
-}
-
-static void GLAPIENTRY _save_MultiTexCoord2fv( GLenum target, const GLfloat *v )
-{
- GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0;
- DISPATCH_ATTR2FV( attr, v );
-}
-
-static void GLAPIENTRY _save_MultiTexCoord3f( GLenum target, GLfloat x, GLfloat y,
- GLfloat z)
-{
- GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0;
- DISPATCH_ATTR3F( attr, x, y, z );
-}
-
-static void GLAPIENTRY _save_MultiTexCoord3fv( GLenum target, const GLfloat *v )
-{
- GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0;
- DISPATCH_ATTR3FV( attr, v );
-}
-
-static void GLAPIENTRY _save_MultiTexCoord4f( GLenum target, GLfloat x, GLfloat y,
- GLfloat z, GLfloat w )
-{
- GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0;
- DISPATCH_ATTR4F( attr, x, y, z, w );
-}
-
-static void GLAPIENTRY _save_MultiTexCoord4fv( GLenum target, const GLfloat *v )
-{
- GLuint attr = (target & 0x7) + _TNL_ATTRIB_TEX0;
- DISPATCH_ATTR4FV( attr, v );
-}
-
-
-
-static void GLAPIENTRY
-_save_VertexAttrib1fNV(GLuint index, GLfloat x)
-{
- if (index < MAX_VERTEX_PROGRAM_ATTRIBS) {
- if (index > 0)
- index += VERT_ATTRIB_GENERIC0;
- DISPATCH_ATTR1F( index, x );
- }
- else
- enum_error();
-}
-
-static void GLAPIENTRY
-_save_VertexAttrib1fvNV(GLuint index, const GLfloat *v)
-{
- if (index < MAX_VERTEX_PROGRAM_ATTRIBS) {
- if (index > 0)
- index += VERT_ATTRIB_GENERIC0;
- DISPATCH_ATTR1FV( index, v );
- }
- else
- enum_error();
-}
-
-static void GLAPIENTRY
-_save_VertexAttrib2fNV(GLuint index, GLfloat x, GLfloat y)
-{
- if (index < MAX_VERTEX_PROGRAM_ATTRIBS) {
- if (index > 0)
- index += VERT_ATTRIB_GENERIC0;
- DISPATCH_ATTR2F( index, x, y );
- }
- else
- enum_error();
-}
-
-static void GLAPIENTRY
-_save_VertexAttrib2fvNV(GLuint index, const GLfloat *v)
-{
- if (index < MAX_VERTEX_PROGRAM_ATTRIBS) {
- if (index > 0)
- index += VERT_ATTRIB_GENERIC0;
- DISPATCH_ATTR2FV( index, v );
- }
- else
- enum_error();
-}
-
-static void GLAPIENTRY
-_save_VertexAttrib3fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z)
-{
- if (index < MAX_VERTEX_PROGRAM_ATTRIBS) {
- if (index > 0)
- index += VERT_ATTRIB_GENERIC0;
- DISPATCH_ATTR3F( index, x, y, z );
- }
- else
- enum_error();
-}
-
-static void GLAPIENTRY
-_save_VertexAttrib3fvNV(GLuint index, const GLfloat *v)
-{
- if (index < MAX_VERTEX_PROGRAM_ATTRIBS) {
- if (index > 0)
- index += VERT_ATTRIB_GENERIC0;
- DISPATCH_ATTR3FV( index, v );
- }
- else
- enum_error();
-}
-
-static void GLAPIENTRY
-_save_VertexAttrib4fNV(GLuint index, GLfloat x, GLfloat y,
- GLfloat z, GLfloat w)
-{
- if (index < MAX_VERTEX_PROGRAM_ATTRIBS) {
- if (index > 0)
- index += VERT_ATTRIB_GENERIC0;
- DISPATCH_ATTR4F( index, x, y, z, w );
- }
- else
- enum_error();
-}
-
-static void GLAPIENTRY
-_save_VertexAttrib4fvNV(GLuint index, const GLfloat *v)
-{
- if (index < MAX_VERTEX_PROGRAM_ATTRIBS) {
- if (index > 0)
- index += VERT_ATTRIB_GENERIC0;
- DISPATCH_ATTR4FV( index, v );
- }
- else
- enum_error();
-}
-
-static void GLAPIENTRY
-_save_VertexAttrib1fARB(GLuint index, GLfloat x)
-{
- if (index < MAX_VERTEX_ATTRIBS) {
- if (index > 0)
- index += VERT_ATTRIB_GENERIC0;
- DISPATCH_ATTR1F( index, x );
- }
- else
- enum_error();
-}
-
-static void GLAPIENTRY
-_save_VertexAttrib1fvARB(GLuint index, const GLfloat *v)
-{
- if (index < MAX_VERTEX_ATTRIBS) {
- if (index > 0)
- index += VERT_ATTRIB_GENERIC0;
- DISPATCH_ATTR1FV( index, v );
- }
- else
- enum_error();
-}
-
-static void GLAPIENTRY
-_save_VertexAttrib2fARB(GLuint index, GLfloat x, GLfloat y)
-{
- if (index < MAX_VERTEX_ATTRIBS) {
- if (index > 0)
- index += VERT_ATTRIB_GENERIC0;
- DISPATCH_ATTR2F( index, x, y );
- }
- else
- enum_error();
-}
-
-static void GLAPIENTRY
-_save_VertexAttrib2fvARB(GLuint index, const GLfloat *v)
-{
- if (index < MAX_VERTEX_ATTRIBS) {
- if (index > 0)
- index += VERT_ATTRIB_GENERIC0;
- DISPATCH_ATTR2FV( index, v );
- }
- else
- enum_error();
-}
-
-static void GLAPIENTRY
-_save_VertexAttrib3fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z)
-{
- if (index < MAX_VERTEX_ATTRIBS) {
- if (index > 0)
- index += VERT_ATTRIB_GENERIC0;
- DISPATCH_ATTR3F( index, x, y, z );
- }
- else
- enum_error();
-}
-
-static void GLAPIENTRY
-_save_VertexAttrib3fvARB(GLuint index, const GLfloat *v)
-{
- if (index < MAX_VERTEX_ATTRIBS) {
- if (index > 0)
- index += VERT_ATTRIB_GENERIC0;
- DISPATCH_ATTR3FV( index, v );
- }
- else
- enum_error();
-}
-
-static void GLAPIENTRY
-_save_VertexAttrib4fARB(GLuint index, GLfloat x, GLfloat y,
- GLfloat z, GLfloat w)
-{
- if (index < MAX_VERTEX_ATTRIBS) {
- if (index > 0)
- index += VERT_ATTRIB_GENERIC0;
- DISPATCH_ATTR4F( index, x, y, z, w );
- }
- else
- enum_error();
-}
-
-static void GLAPIENTRY
-_save_VertexAttrib4fvARB(GLuint index, const GLfloat *v)
-{
- if (index < MAX_VERTEX_ATTRIBS) {
- if (index > 0)
- index += VERT_ATTRIB_GENERIC0;
- DISPATCH_ATTR4FV( index, v );
- }
- else
- enum_error();
-}
-
-
-/* Materials:
- *
- * These are treated as per-vertex attributes, at indices above where
- * the NV_vertex_program leaves off. There are a lot of good things
- * about treating materials this way.
- *
- * However: I don't want to double the number of generated functions
- * just to cope with this, so I unroll the 'C' varients of CHOOSE and
- * ATTRF into this function, and dispense with codegen and
- * second-level dispatch.
- *
- * There is no aliasing of material attributes with other entrypoints.
- */
-#define MAT_ATTR( A, N, params ) \
-do { \
- if (tnl->save.attrsz[A] < N) { \
- _save_upgrade_vertex( ctx, A, N ); \
- tnl->save.have_materials = GL_TRUE; \
- } \
- \
- { \
- GLfloat *dest = tnl->save.attrptr[A]; \
- if (N>0) dest[0] = params[0]; \
- if (N>1) dest[1] = params[1]; \
- if (N>2) dest[2] = params[2]; \
- if (N>3) dest[3] = params[3]; \
- } \
-} while (0)
-
-
-#define MAT( ATTR, N, face, params ) \
-do { \
- if (face != GL_BACK) \
- MAT_ATTR( ATTR, N, params ); /* front */ \
- if (face != GL_FRONT) \
- MAT_ATTR( ATTR + 1, N, params ); /* back */ \
-} while (0)
-
-
-/* NOTE: Have to remove/deal-with colormaterial crossovers, probably
- * later on - in the meantime just store everything.
- */
-static void GLAPIENTRY _save_Materialfv( GLenum face, GLenum pname,
- const GLfloat *params )
-{
- GET_CURRENT_CONTEXT( ctx );
- TNLcontext *tnl = TNL_CONTEXT(ctx);
-
- switch (pname) {
- case GL_EMISSION:
- MAT( _TNL_ATTRIB_MAT_FRONT_EMISSION, 4, face, params );
- break;
- case GL_AMBIENT:
- MAT( _TNL_ATTRIB_MAT_FRONT_AMBIENT, 4, face, params );
- break;
- case GL_DIFFUSE:
- MAT( _TNL_ATTRIB_MAT_FRONT_DIFFUSE, 4, face, params );
- break;
- case GL_SPECULAR:
- MAT( _TNL_ATTRIB_MAT_FRONT_SPECULAR, 4, face, params );
- break;
- case GL_SHININESS:
- MAT( _TNL_ATTRIB_MAT_FRONT_SHININESS, 1, face, params );
- break;
- case GL_COLOR_INDEXES:
- MAT( _TNL_ATTRIB_MAT_FRONT_INDEXES, 3, face, params );
- break;
- case GL_AMBIENT_AND_DIFFUSE:
- MAT( _TNL_ATTRIB_MAT_FRONT_AMBIENT, 4, face, params );
- MAT( _TNL_ATTRIB_MAT_FRONT_DIFFUSE, 4, face, params );
- break;
- default:
- _mesa_compile_error( ctx, GL_INVALID_ENUM, "glMaterialfv" );
- return;
- }
-}
-
-
-#define IDX_ATTR( A, IDX ) \
-do { \
- GET_CURRENT_CONTEXT( ctx ); \
- TNLcontext *tnl = TNL_CONTEXT(ctx); \
- \
- if (tnl->save.attrsz[A] < 1) { \
- _save_upgrade_vertex( ctx, A, 1 ); \
- } \
- \
- { \
- GLfloat *dest = tnl->save.attrptr[A]; \
- dest[0] = IDX; \
- } \
-} while (0)
-
-
-static void GLAPIENTRY _save_EdgeFlag( GLboolean b )
-{
- IDX_ATTR( _TNL_ATTRIB_EDGEFLAG, (GLfloat)b );
-}
-
-
-static void GLAPIENTRY _save_Indexf( GLfloat f )
-{
- IDX_ATTR( _TNL_ATTRIB_COLOR_INDEX, f );
-}
-
-static void GLAPIENTRY _save_Indexfv( const GLfloat *f )
-{
- IDX_ATTR( _TNL_ATTRIB_COLOR_INDEX, f[0] );
-}
-
-
-
-
-/* Cope with EvalCoord/CallList called within a begin/end object:
- * -- Flush current buffer
- * -- Fallback to opcodes for the rest of the begin/end object.
- */
-#define FALLBACK(ctx) \
-do { \
- TNLcontext *tnl = TNL_CONTEXT(ctx); \
- \
- if (tnl->save.initial_counter != tnl->save.counter || \
- tnl->save.prim_count) \
- _save_compile_vertex_list( ctx ); \
- \
- _save_copy_to_current( ctx ); \
- _save_reset_vertex( ctx ); \
- _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt ); \
- ctx->Driver.SaveNeedFlush = 0; \
-} while (0)
-
-static void GLAPIENTRY _save_EvalCoord1f( GLfloat u )
-{
- GET_CURRENT_CONTEXT(ctx);
- FALLBACK(ctx);
- CALL_EvalCoord1f(ctx->Save, ( u ));
-}
-
-static void GLAPIENTRY _save_EvalCoord1fv( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- FALLBACK(ctx);
- CALL_EvalCoord1fv(ctx->Save, ( v ));
-}
-
-static void GLAPIENTRY _save_EvalCoord2f( GLfloat u, GLfloat v )
-{
- GET_CURRENT_CONTEXT(ctx);
- FALLBACK(ctx);
- CALL_EvalCoord2f(ctx->Save, ( u, v ));
-}
-
-static void GLAPIENTRY _save_EvalCoord2fv( const GLfloat *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- FALLBACK(ctx);
- CALL_EvalCoord2fv(ctx->Save, ( v ));
-}
-
-static void GLAPIENTRY _save_EvalPoint1( GLint i )
-{
- GET_CURRENT_CONTEXT(ctx);
- FALLBACK(ctx);
- CALL_EvalPoint1(ctx->Save, ( i ));
-}
-
-static void GLAPIENTRY _save_EvalPoint2( GLint i, GLint j )
-{
- GET_CURRENT_CONTEXT(ctx);
- FALLBACK(ctx);
- CALL_EvalPoint2(ctx->Save, ( i, j ));
-}
-
-static void GLAPIENTRY _save_CallList( GLuint l )
-{
- GET_CURRENT_CONTEXT(ctx);
- FALLBACK(ctx);
- CALL_CallList(ctx->Save, ( l ));
-}
-
-static void GLAPIENTRY _save_CallLists( GLsizei n, GLenum type, const GLvoid *v )
-{
- GET_CURRENT_CONTEXT(ctx);
- FALLBACK(ctx);
- CALL_CallLists(ctx->Save, ( n, type, v ));
-}
-
-
-
-
-/**
- * Called via ctx->Driver.NotifySaveBegin(ctx, mode) when we get a
- * glBegin() call while compiling a display list.
- * See save_Begin() in dlist.c
- *
- * This plugs in our special TNL-related display list functions.
- * All subsequent glBegin/glVertex/glEnd()s found while compiling a
- * display list will get routed to the functions in this file.
- *
- * Updating of ctx->Driver.CurrentSavePrimitive is already taken care of.
- */
-static GLboolean _save_NotifyBegin( GLcontext *ctx, GLenum mode )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
-
- if (1) {
- GLuint i = tnl->save.prim_count++;
-
- assert(i < tnl->save.prim_max);
- tnl->save.prim[i].mode = mode | PRIM_BEGIN;
- tnl->save.prim[i].start = tnl->save.initial_counter - tnl->save.counter;
- tnl->save.prim[i].count = 0;
-
- _mesa_install_save_vtxfmt( ctx, &tnl->save_vtxfmt );
- ctx->Driver.SaveNeedFlush = 1;
- return GL_TRUE;
- }
- else
- return GL_FALSE;
-}
-
-
-
-static void GLAPIENTRY _save_End( void )
-{
- GET_CURRENT_CONTEXT( ctx );
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLint i = tnl->save.prim_count - 1;
-
- ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END;
- if (ctx->ExecuteFlag)
- ctx->Driver.CurrentExecPrimitive = PRIM_OUTSIDE_BEGIN_END;
-
- tnl->save.prim[i].mode |= PRIM_END;
- tnl->save.prim[i].count = ((tnl->save.initial_counter - tnl->save.counter) -
- tnl->save.prim[i].start);
-
- if (i == (GLint) tnl->save.prim_max - 1) {
- _save_compile_vertex_list( ctx );
- assert(tnl->save.copied.nr == 0);
- }
-
- /* Swap out this vertex format while outside begin/end. Any color,
- * etc. received between here and the next begin will be compiled
- * as opcodes.
- */
- _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt );
-}
-
-
-/* These are all errors as this vtxfmt is only installed inside
- * begin/end pairs.
- */
-static void GLAPIENTRY _save_DrawElements(GLenum mode, GLsizei count, GLenum type,
- const GLvoid *indices)
-{
- GET_CURRENT_CONTEXT(ctx);
- (void) mode; (void) count; (void) type; (void) indices;
- _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawElements" );
-}
-
-
-static void GLAPIENTRY _save_DrawRangeElements(GLenum mode,
- GLuint start, GLuint end,
- GLsizei count, GLenum type,
- const GLvoid *indices)
-{
- GET_CURRENT_CONTEXT(ctx);
- (void) mode; (void) start; (void) end; (void) count; (void) type; (void) indices;
- _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawRangeElements" );
-}
-
-static void GLAPIENTRY _save_DrawArrays(GLenum mode, GLint start, GLsizei count)
-{
- GET_CURRENT_CONTEXT(ctx);
- (void) mode; (void) start; (void) count;
- _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glDrawArrays" );
-}
-
-static void GLAPIENTRY _save_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
-{
- GET_CURRENT_CONTEXT(ctx);
- (void) x1; (void) y1; (void) x2; (void) y2;
- _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glRectf" );
-}
-
-static void GLAPIENTRY _save_EvalMesh1( GLenum mode, GLint i1, GLint i2 )
-{
- GET_CURRENT_CONTEXT(ctx);
- (void) mode; (void) i1; (void) i2;
- _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glEvalMesh1" );
-}
-
-static void GLAPIENTRY _save_EvalMesh2( GLenum mode, GLint i1, GLint i2,
- GLint j1, GLint j2 )
-{
- GET_CURRENT_CONTEXT(ctx);
- (void) mode; (void) i1; (void) i2; (void) j1; (void) j2;
- _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glEvalMesh2" );
-}
-
-/**
- * This is only called if someone tries to compile nested glBegin()s
- * in their display list.
- */
-static void GLAPIENTRY _save_Begin( GLenum mode )
-{
- GET_CURRENT_CONTEXT( ctx );
- (void) mode;
- _mesa_compile_error(ctx, GL_INVALID_OPERATION,
- "glBegin(called inside glBegin/End)");
-}
-
-
-/* Unlike the functions above, these are to be hooked into the vtxfmt
- * maintained in ctx->ListState, active when the list is known or
- * suspected to be outside any begin/end primitive.
- */
-static void GLAPIENTRY _save_OBE_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
-{
- GET_CURRENT_CONTEXT(ctx);
- _save_NotifyBegin( ctx, GL_QUADS | PRIM_WEAK );
- CALL_Vertex2f(GET_DISPATCH(), ( x1, y1 ));
- CALL_Vertex2f(GET_DISPATCH(), ( x2, y1 ));
- CALL_Vertex2f(GET_DISPATCH(), ( x2, y2 ));
- CALL_Vertex2f(GET_DISPATCH(), ( x1, y2 ));
- CALL_End(GET_DISPATCH(), ());
-}
-
-
-static void GLAPIENTRY _save_OBE_DrawArrays(GLenum mode, GLint start, GLsizei count)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLint i;
-
- if (!_mesa_validate_DrawArrays( ctx, mode, start, count ))
- return;
-
- _ae_map_vbos( ctx );
-
- _save_NotifyBegin( ctx, mode | PRIM_WEAK );
- for (i = 0; i < count; i++)
- CALL_ArrayElement(GET_DISPATCH(), (start + i));
- CALL_End(GET_DISPATCH(), ());
-
- _ae_unmap_vbos( ctx );
-}
-
-
-static void GLAPIENTRY _save_OBE_DrawElements(GLenum mode, GLsizei count, GLenum type,
- const GLvoid *indices)
-{
- GET_CURRENT_CONTEXT(ctx);
- GLint i;
-
- if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices ))
- return;
-
- _ae_map_vbos( ctx );
-
- _save_NotifyBegin( ctx, mode | PRIM_WEAK );
-
- switch (type) {
- case GL_UNSIGNED_BYTE:
- for (i = 0 ; i < count ; i++)
- CALL_ArrayElement(GET_DISPATCH(), ( ((GLubyte *)indices)[i] ));
- break;
- case GL_UNSIGNED_SHORT:
- for (i = 0 ; i < count ; i++)
- CALL_ArrayElement(GET_DISPATCH(), ( ((GLushort *)indices)[i] ));
- break;
- case GL_UNSIGNED_INT:
- for (i = 0 ; i < count ; i++)
- CALL_ArrayElement(GET_DISPATCH(), ( ((GLuint *)indices)[i] ));
- break;
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glDrawElements(type)" );
- break;
- }
-
- CALL_End(GET_DISPATCH(), ());
-
- _ae_unmap_vbos( ctx );
-}
-
-static void GLAPIENTRY _save_OBE_DrawRangeElements(GLenum mode,
- GLuint start, GLuint end,
- GLsizei count, GLenum type,
- const GLvoid *indices)
-{
- GET_CURRENT_CONTEXT(ctx);
- if (_mesa_validate_DrawRangeElements( ctx, mode,
- start, end,
- count, type, indices ))
- _save_OBE_DrawElements( mode, count, type, indices );
-}
-
-
-
-
-
-static void _save_vtxfmt_init( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLvertexformat *vfmt = &tnl->save_vtxfmt;
-
- vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */
- vfmt->Begin = _save_Begin;
- vfmt->Color3f = _save_Color3f;
- vfmt->Color3fv = _save_Color3fv;
- vfmt->Color4f = _save_Color4f;
- vfmt->Color4fv = _save_Color4fv;
- vfmt->EdgeFlag = _save_EdgeFlag;
- vfmt->End = _save_End;
- vfmt->FogCoordfEXT = _save_FogCoordfEXT;
- vfmt->FogCoordfvEXT = _save_FogCoordfvEXT;
- vfmt->Indexf = _save_Indexf;
- vfmt->Indexfv = _save_Indexfv;
- vfmt->Materialfv = _save_Materialfv;
- vfmt->MultiTexCoord1fARB = _save_MultiTexCoord1f;
- vfmt->MultiTexCoord1fvARB = _save_MultiTexCoord1fv;
- vfmt->MultiTexCoord2fARB = _save_MultiTexCoord2f;
- vfmt->MultiTexCoord2fvARB = _save_MultiTexCoord2fv;
- vfmt->MultiTexCoord3fARB = _save_MultiTexCoord3f;
- vfmt->MultiTexCoord3fvARB = _save_MultiTexCoord3fv;
- vfmt->MultiTexCoord4fARB = _save_MultiTexCoord4f;
- vfmt->MultiTexCoord4fvARB = _save_MultiTexCoord4fv;
- vfmt->Normal3f = _save_Normal3f;
- vfmt->Normal3fv = _save_Normal3fv;
- vfmt->SecondaryColor3fEXT = _save_SecondaryColor3fEXT;
- vfmt->SecondaryColor3fvEXT = _save_SecondaryColor3fvEXT;
- vfmt->TexCoord1f = _save_TexCoord1f;
- vfmt->TexCoord1fv = _save_TexCoord1fv;
- vfmt->TexCoord2f = _save_TexCoord2f;
- vfmt->TexCoord2fv = _save_TexCoord2fv;
- vfmt->TexCoord3f = _save_TexCoord3f;
- vfmt->TexCoord3fv = _save_TexCoord3fv;
- vfmt->TexCoord4f = _save_TexCoord4f;
- vfmt->TexCoord4fv = _save_TexCoord4fv;
- vfmt->Vertex2f = _save_Vertex2f;
- vfmt->Vertex2fv = _save_Vertex2fv;
- vfmt->Vertex3f = _save_Vertex3f;
- vfmt->Vertex3fv = _save_Vertex3fv;
- vfmt->Vertex4f = _save_Vertex4f;
- vfmt->Vertex4fv = _save_Vertex4fv;
- vfmt->VertexAttrib1fNV = _save_VertexAttrib1fNV;
- vfmt->VertexAttrib1fvNV = _save_VertexAttrib1fvNV;
- vfmt->VertexAttrib2fNV = _save_VertexAttrib2fNV;
- vfmt->VertexAttrib2fvNV = _save_VertexAttrib2fvNV;
- vfmt->VertexAttrib3fNV = _save_VertexAttrib3fNV;
- vfmt->VertexAttrib3fvNV = _save_VertexAttrib3fvNV;
- vfmt->VertexAttrib4fNV = _save_VertexAttrib4fNV;
- vfmt->VertexAttrib4fvNV = _save_VertexAttrib4fvNV;
- vfmt->VertexAttrib1fARB = _save_VertexAttrib1fARB;
- vfmt->VertexAttrib1fvARB = _save_VertexAttrib1fvARB;
- vfmt->VertexAttrib2fARB = _save_VertexAttrib2fARB;
- vfmt->VertexAttrib2fvARB = _save_VertexAttrib2fvARB;
- vfmt->VertexAttrib3fARB = _save_VertexAttrib3fARB;
- vfmt->VertexAttrib3fvARB = _save_VertexAttrib3fvARB;
- vfmt->VertexAttrib4fARB = _save_VertexAttrib4fARB;
- vfmt->VertexAttrib4fvARB = _save_VertexAttrib4fvARB;
-
- /* This will all require us to fallback to saving the list as opcodes:
- */
- vfmt->CallList = _save_CallList; /* inside begin/end */
- vfmt->CallLists = _save_CallLists; /* inside begin/end */
- vfmt->EvalCoord1f = _save_EvalCoord1f;
- vfmt->EvalCoord1fv = _save_EvalCoord1fv;
- vfmt->EvalCoord2f = _save_EvalCoord2f;
- vfmt->EvalCoord2fv = _save_EvalCoord2fv;
- vfmt->EvalPoint1 = _save_EvalPoint1;
- vfmt->EvalPoint2 = _save_EvalPoint2;
-
- /* These are all errors as we at least know we are in some sort of
- * begin/end pair:
- */
- vfmt->EvalMesh1 = _save_EvalMesh1;
- vfmt->EvalMesh2 = _save_EvalMesh2;
- vfmt->Begin = _save_Begin;
- vfmt->Rectf = _save_Rectf;
- vfmt->DrawArrays = _save_DrawArrays;
- vfmt->DrawElements = _save_DrawElements;
- vfmt->DrawRangeElements = _save_DrawRangeElements;
-
-}
-
-
-void _tnl_SaveFlushVertices( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
-
- /* Noop when we are actually active:
- */
- if (ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM ||
- ctx->Driver.CurrentSavePrimitive <= GL_POLYGON)
- return;
-
- if (tnl->save.initial_counter != tnl->save.counter ||
- tnl->save.prim_count)
- _save_compile_vertex_list( ctx );
-
- _save_copy_to_current( ctx );
- _save_reset_vertex( ctx );
- ctx->Driver.SaveNeedFlush = 0;
-}
-
-void _tnl_NewList( GLcontext *ctx, GLuint list, GLenum mode )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
-
- (void) list; (void) mode;
-
- if (!tnl->save.prim_store)
- tnl->save.prim_store = alloc_prim_store( ctx );
-
- if (!tnl->save.vertex_store) {
- tnl->save.vertex_store = alloc_vertex_store( ctx );
- tnl->save.vbptr = tnl->save.vertex_store->buffer;
- }
-
- _save_reset_vertex( ctx );
- ctx->Driver.SaveNeedFlush = 0;
-}
-
-void _tnl_EndList( GLcontext *ctx )
-{
- (void) ctx;
- assert(TNL_CONTEXT(ctx)->save.vertex_size == 0);
-}
-
-void _tnl_BeginCallList( GLcontext *ctx, struct mesa_display_list *dlist )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->save.replay_flags |= dlist->flags;
- tnl->save.replay_flags |= tnl->LoopbackDListCassettes;
-}
-
-void _tnl_EndCallList( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
-
- if (ctx->ListState.CallDepth == 1)
- tnl->save.replay_flags = 0;
-}
-
-
-static void _tnl_destroy_vertex_list( GLcontext *ctx, void *data )
-{
- struct tnl_vertex_list *node = (struct tnl_vertex_list *)data;
- (void) ctx;
-
- if ( --node->vertex_store->refcount == 0 )
- FREE( node->vertex_store );
-
- if ( --node->prim_store->refcount == 0 )
- FREE( node->prim_store );
-
- if ( node->normal_lengths )
- FREE( node->normal_lengths );
-}
-
-
-static void _tnl_print_vertex_list( GLcontext *ctx, void *data )
-{
- struct tnl_vertex_list *node = (struct tnl_vertex_list *)data;
- GLuint i;
- (void) ctx;
-
- _mesa_debug(NULL, "TNL-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 tnl_prim *prim = &node->prim[i];
- _mesa_debug(NULL, " prim %d: %s %d..%d %s %s\n",
- i,
- _mesa_lookup_enum_by_nr(prim->mode & PRIM_MODE_MASK),
- prim->start,
- prim->start + prim->count,
- (prim->mode & PRIM_BEGIN) ? "BEGIN" : "(wrap)",
- (prim->mode & PRIM_END) ? "END" : "(wrap)");
- }
-}
-
-
-static void _save_current_init( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLint i;
-
- for (i = 0; i < _TNL_ATTRIB_MAT_FRONT_AMBIENT; i++) {
- ASSERT(i < VERT_ATTRIB_MAX);
- tnl->save.currentsz[i] = &ctx->ListState.ActiveAttribSize[i];
- tnl->save.current[i] = ctx->ListState.CurrentAttrib[i];
- }
-
- for (i = _TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) {
- const GLuint j = i - _TNL_FIRST_MAT;
- ASSERT(j < MAT_ATTRIB_MAX);
- tnl->save.currentsz[i] = &ctx->ListState.ActiveMaterialSize[j];
- tnl->save.current[i] = ctx->ListState.CurrentMaterial[j];
- }
-
- tnl->save.currentsz[_TNL_ATTRIB_EDGEFLAG] = &ctx->ListState.ActiveEdgeFlag;
- tnl->save.current[_TNL_ATTRIB_EDGEFLAG] = &tnl->save.CurrentFloatEdgeFlag;
-}
-
-/**
- * Initialize the display list compiler
- */
-void _tnl_save_init( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct tnl_vertex_arrays *tmp = &tnl->save_inputs;
- GLuint i;
-
-
- for (i = 0; i < _TNL_ATTRIB_MAX; i++)
- _mesa_vector4f_init( &tmp->Attribs[i], 0, NULL);
-
- tnl->save.opcode_vertex_list =
- _mesa_alloc_opcode( ctx,
- sizeof(struct tnl_vertex_list),
- _tnl_playback_vertex_list,
- _tnl_destroy_vertex_list,
- _tnl_print_vertex_list );
-
- ctx->Driver.NotifySaveBegin = _save_NotifyBegin;
-
- _save_vtxfmt_init( ctx );
- _save_current_init( ctx );
-
- /* Hook our array functions into the outside-begin-end vtxfmt in
- * ctx->ListState.
- */
- ctx->ListState.ListVtxfmt.Rectf = _save_OBE_Rectf;
- ctx->ListState.ListVtxfmt.DrawArrays = _save_OBE_DrawArrays;
- ctx->ListState.ListVtxfmt.DrawElements = _save_OBE_DrawElements;
- ctx->ListState.ListVtxfmt.DrawRangeElements = _save_OBE_DrawRangeElements;
- _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt );
-}
-
-
-/**
- * Deallocate the immediate-mode buffer for the given context, if
- * its reference count goes to zero.
- */
-void _tnl_save_destroy( GLcontext *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
-
- /* Decrement the refcounts. References may still be held by
- * display lists yet to be destroyed, so it may not yet be time to
- * free these items.
- */
- if (tnl->save.prim_store &&
- --tnl->save.prim_store->refcount == 0 )
- FREE( tnl->save.prim_store );
-
- if (tnl->save.vertex_store &&
- --tnl->save.vertex_store->refcount == 0 )
- FREE( tnl->save.vertex_store );
-}
diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index 8d13ef9d08..2d4ded0f98 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -43,6 +43,11 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "vbo_context.h"
+#ifdef ERROR
+#undef ERROR
+#endif
+
+
static void reset_attrfv( struct vbo_exec_context *exec );
diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
index c08fd1fe55..e7794c2a6c 100644
--- a/src/mesa/vbo/vbo_save_api.c
+++ b/src/mesa/vbo/vbo_save_api.c
@@ -80,6 +80,10 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "vbo_context.h"
+#ifdef ERROR
+#undef ERROR
+#endif
+
/*
* NOTE: Old 'parity' issue is gone, but copying can still be
diff --git a/src/mesa/x86-64/glapi_x86-64.S b/src/mesa/x86-64/glapi_x86-64.S
index e62dde8a2f..171e95d1b8 100644
--- a/src/mesa/x86-64/glapi_x86-64.S
+++ b/src/mesa/x86-64/glapi_x86-64.S
@@ -29398,12 +29398,17 @@ GL_PREFIX(_dispatch_stub_772):
.globl GL_PREFIX(VertexAttrib4Nubv) ; .set GL_PREFIX(VertexAttrib4Nubv), GL_PREFIX(VertexAttrib4NubvARB)
.globl GL_PREFIX(VertexAttrib4Nuiv) ; .set GL_PREFIX(VertexAttrib4Nuiv), GL_PREFIX(VertexAttrib4NuivARB)
.globl GL_PREFIX(VertexAttrib4Nusv) ; .set GL_PREFIX(VertexAttrib4Nusv), GL_PREFIX(VertexAttrib4NusvARB)
+ .globl GL_PREFIX(VertexAttrib4bv) ; .set GL_PREFIX(VertexAttrib4bv), GL_PREFIX(VertexAttrib4bvARB)
.globl GL_PREFIX(VertexAttrib4d) ; .set GL_PREFIX(VertexAttrib4d), GL_PREFIX(VertexAttrib4dARB)
.globl GL_PREFIX(VertexAttrib4dv) ; .set GL_PREFIX(VertexAttrib4dv), GL_PREFIX(VertexAttrib4dvARB)
.globl GL_PREFIX(VertexAttrib4f) ; .set GL_PREFIX(VertexAttrib4f), GL_PREFIX(VertexAttrib4fARB)
.globl GL_PREFIX(VertexAttrib4fv) ; .set GL_PREFIX(VertexAttrib4fv), GL_PREFIX(VertexAttrib4fvARB)
+ .globl GL_PREFIX(VertexAttrib4iv) ; .set GL_PREFIX(VertexAttrib4iv), GL_PREFIX(VertexAttrib4ivARB)
.globl GL_PREFIX(VertexAttrib4s) ; .set GL_PREFIX(VertexAttrib4s), GL_PREFIX(VertexAttrib4sARB)
.globl GL_PREFIX(VertexAttrib4sv) ; .set GL_PREFIX(VertexAttrib4sv), GL_PREFIX(VertexAttrib4svARB)
+ .globl GL_PREFIX(VertexAttrib4ubv) ; .set GL_PREFIX(VertexAttrib4ubv), GL_PREFIX(VertexAttrib4ubvARB)
+ .globl GL_PREFIX(VertexAttrib4uiv) ; .set GL_PREFIX(VertexAttrib4uiv), GL_PREFIX(VertexAttrib4uivARB)
+ .globl GL_PREFIX(VertexAttrib4usv) ; .set GL_PREFIX(VertexAttrib4usv), GL_PREFIX(VertexAttrib4usvARB)
.globl GL_PREFIX(VertexAttribPointer) ; .set GL_PREFIX(VertexAttribPointer), GL_PREFIX(VertexAttribPointerARB)
.globl GL_PREFIX(BindBuffer) ; .set GL_PREFIX(BindBuffer), GL_PREFIX(BindBufferARB)
.globl GL_PREFIX(BufferData) ; .set GL_PREFIX(BufferData), GL_PREFIX(BufferDataARB)
diff --git a/src/mesa/x86/glapi_x86.S b/src/mesa/x86/glapi_x86.S
index 74e93721bc..1d04779d14 100644
--- a/src/mesa/x86/glapi_x86.S
+++ b/src/mesa/x86/glapi_x86.S
@@ -63,6 +63,7 @@
#else
# define CTX_INSNS NOP /* Pad for init_glapi_relocs() */
#endif
+
# define GL_STUB(fn,off,fn_alt) \
ALIGNTEXT16; \
GLOBL_FN(GL_PREFIX(fn, fn_alt)); \
@@ -1128,12 +1129,17 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB_ALIAS(VertexAttrib4Nubv, _gloffset_VertexAttrib4NubvARB, VertexAttrib4Nubv@8, VertexAttrib4NubvARB, VertexAttrib4NubvARB@8)
GL_STUB_ALIAS(VertexAttrib4Nuiv, _gloffset_VertexAttrib4NuivARB, VertexAttrib4Nuiv@8, VertexAttrib4NuivARB, VertexAttrib4NuivARB@8)
GL_STUB_ALIAS(VertexAttrib4Nusv, _gloffset_VertexAttrib4NusvARB, VertexAttrib4Nusv@8, VertexAttrib4NusvARB, VertexAttrib4NusvARB@8)
+ GL_STUB_ALIAS(VertexAttrib4bv, _gloffset_VertexAttrib4bvARB, VertexAttrib4bv@8, VertexAttrib4bvARB, VertexAttrib4bvARB@8)
GL_STUB_ALIAS(VertexAttrib4d, _gloffset_VertexAttrib4dARB, VertexAttrib4d@36, VertexAttrib4dARB, VertexAttrib4dARB@36)
GL_STUB_ALIAS(VertexAttrib4dv, _gloffset_VertexAttrib4dvARB, VertexAttrib4dv@8, VertexAttrib4dvARB, VertexAttrib4dvARB@8)
GL_STUB_ALIAS(VertexAttrib4f, _gloffset_VertexAttrib4fARB, VertexAttrib4f@20, VertexAttrib4fARB, VertexAttrib4fARB@20)
GL_STUB_ALIAS(VertexAttrib4fv, _gloffset_VertexAttrib4fvARB, VertexAttrib4fv@8, VertexAttrib4fvARB, VertexAttrib4fvARB@8)
+ GL_STUB_ALIAS(VertexAttrib4iv, _gloffset_VertexAttrib4ivARB, VertexAttrib4iv@8, VertexAttrib4ivARB, VertexAttrib4ivARB@8)
GL_STUB_ALIAS(VertexAttrib4s, _gloffset_VertexAttrib4sARB, VertexAttrib4s@20, VertexAttrib4sARB, VertexAttrib4sARB@20)
GL_STUB_ALIAS(VertexAttrib4sv, _gloffset_VertexAttrib4svARB, VertexAttrib4sv@8, VertexAttrib4svARB, VertexAttrib4svARB@8)
+ GL_STUB_ALIAS(VertexAttrib4ubv, _gloffset_VertexAttrib4ubvARB, VertexAttrib4ubv@8, VertexAttrib4ubvARB, VertexAttrib4ubvARB@8)
+ GL_STUB_ALIAS(VertexAttrib4uiv, _gloffset_VertexAttrib4uivARB, VertexAttrib4uiv@8, VertexAttrib4uivARB, VertexAttrib4uivARB@8)
+ GL_STUB_ALIAS(VertexAttrib4usv, _gloffset_VertexAttrib4usvARB, VertexAttrib4usv@8, VertexAttrib4usvARB, VertexAttrib4usvARB@8)
GL_STUB_ALIAS(VertexAttribPointer, _gloffset_VertexAttribPointerARB, VertexAttribPointer@24, VertexAttribPointerARB, VertexAttribPointerARB@24)
GL_STUB_ALIAS(BindBuffer, _gloffset_BindBufferARB, BindBuffer@8, BindBufferARB, BindBufferARB@8)
GL_STUB_ALIAS(BufferData, _gloffset_BufferDataARB, BufferData@16, BufferDataARB, BufferDataARB@16)