/*
* Mesa 3-D graphics library
- * Version: 7.1
+ * Version: 7.7
*
- * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
#include "api_loopback.h"
#include "config.h"
#include "mfeatures.h"
-#include "attrib.h"
-#include "blend.h"
-#include "buffers.h"
#if FEATURE_ARB_vertex_buffer_object
#include "bufferobj.h"
#endif
#include "arrayobj.h"
-#include "clip.h"
-#include "colortab.h"
#include "context.h"
-#include "convolve.h"
-#include "depth.h"
#include "dlist.h"
-#include "enable.h"
#include "enums.h"
#include "eval.h"
-#include "extensions.h"
-#include "feedback.h"
#include "framebuffer.h"
-#include "get.h"
#include "glapi/glapi.h"
#include "hash.h"
-#include "histogram.h"
#include "image.h"
#include "light.h"
-#include "lines.h"
#include "dlist.h"
#include "macros.h"
-#include "matrix.h"
-#include "pixel.h"
-#include "points.h"
-#include "polygon.h"
#include "queryobj.h"
-#include "state.h"
-#include "texobj.h"
#include "teximage.h"
-#include "texstate.h"
#include "mtypes.h"
#include "varray.h"
-#include "vtxfmt.h"
#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
#include "shader/arbprogram.h"
-#include "shader/program.h"
#endif
#if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
#include "shader/nvprogram.h"
-#include "shader/program.h"
#endif
#if FEATURE_ATI_fragment_shader
#include "shader/atifragshader.h"
#include "math/m_matrix.h"
-#include "glapi/dispatch.h"
+#include "main/dispatch.h"
+
+
+
+/**
+ * Other parts of Mesa (such as the VBO module) can plug into the display
+ * list system. This structure describes new display list instructions.
+ */
+struct gl_list_instruction
+{
+ GLuint Size;
+ void (*Execute)( GLcontext *ctx, void *data );
+ void (*Destroy)( GLcontext *ctx, void *data );
+ void (*Print)( GLcontext *ctx, void *data );
+};
+
+
+#define MAX_DLIST_EXT_OPCODES 16
+
+/**
+ * Used by device drivers to hook new commands into display lists.
+ */
+struct gl_list_extensions
+{
+ struct gl_list_instruction Opcode[MAX_DLIST_EXT_OPCODES];
+ GLuint NumOpcodes;
+};
+
/**
OPCODE_CLEAR_DEPTH,
OPCODE_CLEAR_INDEX,
OPCODE_CLEAR_STENCIL,
+ OPCODE_CLEAR_BUFFER_IV,
+ OPCODE_CLEAR_BUFFER_UIV,
+ OPCODE_CLEAR_BUFFER_FV,
+ OPCODE_CLEAR_BUFFER_FI,
OPCODE_CLIP_PLANE,
OPCODE_COLOR_MASK,
+ OPCODE_COLOR_MASK_INDEXED,
OPCODE_COLOR_MATERIAL,
OPCODE_COLOR_TABLE,
OPCODE_COLOR_TABLE_PARAMETER_FV,
OPCODE_DEPTH_MASK,
OPCODE_DEPTH_RANGE,
OPCODE_DISABLE,
+ OPCODE_DISABLE_INDEXED,
OPCODE_DRAW_BUFFER,
OPCODE_DRAW_PIXELS,
OPCODE_ENABLE,
+ OPCODE_ENABLE_INDEXED,
OPCODE_EVALMESH1,
OPCODE_EVALMESH2,
OPCODE_FOG,
{
struct gl_display_list *dlist = CALLOC_STRUCT(gl_display_list);
dlist->Name = name;
- dlist->Head = (Node *) _mesa_malloc(sizeof(Node) * count);
+ dlist->Head = (Node *) malloc(sizeof(Node) * count);
dlist->Head[0].opcode = OPCODE_END_OF_LIST;
return dlist;
}
}
+/** Is the given opcode an extension code? */
+static INLINE GLboolean
+is_ext_opcode(OpCode opcode)
+{
+ return (opcode >= OPCODE_EXT_0);
+}
+
+
+/** Destroy an extended opcode instruction */
+static GLint
+ext_opcode_destroy(GLcontext *ctx, Node *node)
+{
+ const GLint i = node[0].opcode - OPCODE_EXT_0;
+ GLint step;
+ ctx->ListExt->Opcode[i].Destroy(ctx, &node[1]);
+ step = ctx->ListExt->Opcode[i].Size;
+ return step;
+}
+
+
+/** Execute an extended opcode instruction */
+static GLint
+ext_opcode_execute(GLcontext *ctx, Node *node)
+{
+ const GLint i = node[0].opcode - OPCODE_EXT_0;
+ GLint step;
+ ctx->ListExt->Opcode[i].Execute(ctx, &node[1]);
+ step = ctx->ListExt->Opcode[i].Size;
+ return step;
+}
+
+
+/** Print an extended opcode instruction */
+static GLint
+ext_opcode_print(GLcontext *ctx, Node *node)
+{
+ const GLint i = node[0].opcode - OPCODE_EXT_0;
+ GLint step;
+ ctx->ListExt->Opcode[i].Print(ctx, &node[1]);
+ step = ctx->ListExt->Opcode[i].Size;
+ return step;
+}
+
/**
* Delete the named display list, but don't remove from hash table.
done = block ? GL_FALSE : GL_TRUE;
while (!done) {
+ const OpCode opcode = n[0].opcode;
/* check for extension opcodes first */
-
- GLint i = (GLint) n[0].opcode - (GLint) OPCODE_EXT_0;
- if (i >= 0 && i < (GLint) ctx->ListExt.NumOpcodes) {
- ctx->ListExt.Opcode[i].Destroy(ctx, &n[1]);
- n += ctx->ListExt.Opcode[i].Size;
+ if (is_ext_opcode(opcode)) {
+ n += ext_opcode_destroy(ctx, n);
}
else {
- switch (n[0].opcode) {
+ switch (opcode) {
/* for some commands, we need to free malloc'd memory */
case OPCODE_MAP1:
- _mesa_free(n[6].data);
+ free(n[6].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_MAP2:
- _mesa_free(n[10].data);
+ free(n[10].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_DRAW_PIXELS:
- _mesa_free(n[5].data);
+ free(n[5].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_BITMAP:
- _mesa_free(n[7].data);
+ free(n[7].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_COLOR_TABLE:
- _mesa_free(n[6].data);
+ free(n[6].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_COLOR_SUB_TABLE:
- _mesa_free(n[6].data);
+ free(n[6].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_CONVOLUTION_FILTER_1D:
- _mesa_free(n[6].data);
+ free(n[6].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_CONVOLUTION_FILTER_2D:
- _mesa_free(n[7].data);
+ free(n[7].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_POLYGON_STIPPLE:
- _mesa_free(n[1].data);
+ free(n[1].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_TEX_IMAGE1D:
- _mesa_free(n[8].data);
+ free(n[8].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_TEX_IMAGE2D:
- _mesa_free(n[9].data);
+ free(n[9].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_TEX_IMAGE3D:
- _mesa_free(n[10].data);
+ free(n[10].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_TEX_SUB_IMAGE1D:
- _mesa_free(n[7].data);
+ free(n[7].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_TEX_SUB_IMAGE2D:
- _mesa_free(n[9].data);
+ free(n[9].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_TEX_SUB_IMAGE3D:
- _mesa_free(n[11].data);
+ free(n[11].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_COMPRESSED_TEX_IMAGE_1D:
- _mesa_free(n[7].data);
+ free(n[7].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_COMPRESSED_TEX_IMAGE_2D:
- _mesa_free(n[8].data);
+ free(n[8].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_COMPRESSED_TEX_IMAGE_3D:
- _mesa_free(n[9].data);
+ free(n[9].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D:
- _mesa_free(n[7].data);
+ free(n[7].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D:
- _mesa_free(n[9].data);
+ free(n[9].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D:
- _mesa_free(n[11].data);
+ free(n[11].data);
n += InstSize[n[0].opcode];
break;
#if FEATURE_NV_vertex_program
case OPCODE_LOAD_PROGRAM_NV:
- _mesa_free(n[4].data); /* program string */
+ free(n[4].data); /* program string */
n += InstSize[n[0].opcode];
break;
case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV:
- _mesa_free(n[2].data); /* array of program ids */
+ free(n[2].data); /* array of program ids */
n += InstSize[n[0].opcode];
break;
#endif
#if FEATURE_NV_fragment_program
case OPCODE_PROGRAM_NAMED_PARAMETER_NV:
- _mesa_free(n[3].data); /* parameter name */
+ free(n[3].data); /* parameter name */
n += InstSize[n[0].opcode];
break;
#endif
#if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
case OPCODE_PROGRAM_STRING_ARB:
- _mesa_free(n[4].data); /* program string */
+ free(n[4].data); /* program string */
n += InstSize[n[0].opcode];
break;
#endif
case OPCODE_UNIFORM_2IV:
case OPCODE_UNIFORM_3IV:
case OPCODE_UNIFORM_4IV:
- _mesa_free(n[3].data);
+ free(n[3].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_UNIFORM_MATRIX22:
case OPCODE_UNIFORM_MATRIX32:
case OPCODE_UNIFORM_MATRIX34:
case OPCODE_UNIFORM_MATRIX43:
- _mesa_free(n[4].data);
+ free(n[4].data);
n += InstSize[n[0].opcode];
break;
case OPCODE_CONTINUE:
n = (Node *) n[1].next;
- _mesa_free(block);
+ free(block);
block = n;
break;
case OPCODE_END_OF_LIST:
- _mesa_free(block);
+ free(block);
done = GL_TRUE;
break;
default:
}
}
- _mesa_free(dlist);
+ free(dlist);
}
/**
- * Allocate space for a display list instruction.
+ * Allocate space for a display list instruction (opcode + payload space).
* \param opcode the instruction opcode (OPCODE_* value)
- * \param bytes instruction size in bytes, not counting opcode.
- * \return pointer to the usable data area (not including the internal
- * opcode).
+ * \param bytes instruction payload size (not counting opcode)
+ * \return pointer to allocated memory (the opcode space)
*/
-void *
-_mesa_alloc_instruction(GLcontext *ctx, GLuint opcode, GLuint bytes)
+static Node *
+dlist_alloc(GLcontext *ctx, OpCode opcode, GLuint bytes)
{
const GLuint numNodes = 1 + (bytes + sizeof(Node) - 1) / sizeof(Node);
Node *n;
Node *newblock;
n = ctx->ListState.CurrentBlock + ctx->ListState.CurrentPos;
n[0].opcode = OPCODE_CONTINUE;
- newblock = (Node *) _mesa_malloc(sizeof(Node) * BLOCK_SIZE);
+ newblock = (Node *) malloc(sizeof(Node) * BLOCK_SIZE);
if (!newblock) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "Building display list");
return NULL;
n = ctx->ListState.CurrentBlock + ctx->ListState.CurrentPos;
ctx->ListState.CurrentPos += numNodes;
- n[0].opcode = (OpCode) opcode;
+ n[0].opcode = opcode;
- return (void *) (n + 1); /* return ptr to node following opcode */
+ return n;
+}
+
+
+
+/**
+ * Allocate space for a display list instruction. Used by callers outside
+ * this file for things like VBO vertex data.
+ *
+ * \param opcode the instruction opcode (OPCODE_* value)
+ * \param bytes instruction size in bytes, not counting opcode.
+ * \return pointer to the usable data area (not including the internal
+ * opcode).
+ */
+void *
+_mesa_dlist_alloc(GLcontext *ctx, GLuint opcode, GLuint bytes)
+{
+ Node *n = dlist_alloc(ctx, (OpCode) opcode, bytes);
+ if (n)
+ return n + 1; /* return pointer to payload area, after opcode */
+ else
+ return NULL;
}
* \return the new opcode number or -1 if error
*/
GLint
-_mesa_alloc_opcode(GLcontext *ctx,
- GLuint size,
- void (*execute) (GLcontext *, void *),
- void (*destroy) (GLcontext *, void *),
- void (*print) (GLcontext *, void *))
-{
- if (ctx->ListExt.NumOpcodes < MAX_DLIST_EXT_OPCODES) {
- const GLuint i = ctx->ListExt.NumOpcodes++;
- ctx->ListExt.Opcode[i].Size =
+_mesa_dlist_alloc_opcode(GLcontext *ctx,
+ GLuint size,
+ void (*execute) (GLcontext *, void *),
+ void (*destroy) (GLcontext *, void *),
+ void (*print) (GLcontext *, void *))
+{
+ if (ctx->ListExt->NumOpcodes < MAX_DLIST_EXT_OPCODES) {
+ const GLuint i = ctx->ListExt->NumOpcodes++;
+ ctx->ListExt->Opcode[i].Size =
1 + (size + sizeof(Node) - 1) / sizeof(Node);
- ctx->ListExt.Opcode[i].Execute = execute;
- ctx->ListExt.Opcode[i].Destroy = destroy;
- ctx->ListExt.Opcode[i].Print = print;
+ ctx->ListExt->Opcode[i].Execute = execute;
+ ctx->ListExt->Opcode[i].Destroy = destroy;
+ ctx->ListExt->Opcode[i].Print = print;
return i + OPCODE_EXT_0;
}
return -1;
}
-
/**
- * Allocate display list instruction. Returns Node ptr to where the opcode
- * is stored.
- * - nParams is the number of function parameters
- * - return value a pointer to sizeof(Node) before the actual
- * usable data area.
+ * Allocate space for a display list instruction. The space is basically
+ * an array of Nodes where node[0] holds the opcode, node[1] is the first
+ * function parameter, node[2] is the second parameter, etc.
+ *
+ * \param opcode one of OPCODE_x
+ * \param nparams number of function parameters
+ * \return pointer to start of instruction space
*/
-#define ALLOC_INSTRUCTION(CTX, OPCODE, NPARAMS) \
- ((Node *)_mesa_alloc_instruction(CTX, OPCODE, (NPARAMS)*sizeof(Node)) - 1)
+static INLINE Node *
+alloc_instruction(GLcontext *ctx, OpCode opcode, GLuint nparams)
+{
+ return dlist_alloc(ctx, opcode, nparams * sizeof(Node));
+}
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_ACCUM, 2);
+ n = alloc_instruction(ctx, OPCODE_ACCUM, 2);
if (n) {
n[1].e = op;
n[2].f = value;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_ALPHA_FUNC, 2);
+ n = alloc_instruction(ctx, OPCODE_ALPHA_FUNC, 2);
if (n) {
n[1].e = func;
n[2].f = (GLfloat) ref;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_BIND_TEXTURE, 2);
+ n = alloc_instruction(ctx, OPCODE_BIND_TEXTURE, 2);
if (n) {
n[1].e = target;
n[2].ui = texture;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_BITMAP, 7);
+ n = alloc_instruction(ctx, OPCODE_BITMAP, 7);
if (n) {
n[1].i = (GLint) width;
n[2].i = (GLint) height;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_BLEND_EQUATION, 1);
+ n = alloc_instruction(ctx, OPCODE_BLEND_EQUATION, 1);
if (n) {
n[1].e = mode;
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_BLEND_EQUATION_SEPARATE, 2);
+ n = alloc_instruction(ctx, OPCODE_BLEND_EQUATION_SEPARATE, 2);
if (n) {
n[1].e = modeRGB;
n[2].e = modeA;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_BLEND_FUNC_SEPARATE, 4);
+ n = alloc_instruction(ctx, OPCODE_BLEND_FUNC_SEPARATE, 4);
if (n) {
n[1].e = sfactorRGB;
n[2].e = dfactorRGB;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_BLEND_COLOR, 4);
+ n = alloc_instruction(ctx, OPCODE_BLEND_COLOR, 4);
if (n) {
n[1].f = red;
n[2].f = green;
Node *n;
SAVE_FLUSH_VERTICES(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_CALL_LIST, 1);
+ n = alloc_instruction(ctx, OPCODE_CALL_LIST, 1);
if (n) {
n[1].ui = list;
}
for (i = 0; i < num; i++) {
GLint list = translate_id(i, type, lists);
- Node *n = ALLOC_INSTRUCTION(ctx, OPCODE_CALL_LIST_OFFSET, 2);
+ Node *n = alloc_instruction(ctx, OPCODE_CALL_LIST_OFFSET, 2);
if (n) {
n[1].i = list;
n[2].b = typeErrorFlag;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_CLEAR, 1);
+ n = alloc_instruction(ctx, OPCODE_CLEAR, 1);
if (n) {
n[1].bf = mask;
}
}
+static void GLAPIENTRY
+save_ClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_CLEAR_BUFFER_IV, 6);
+ if (n) {
+ n[1].e = buffer;
+ n[2].i = drawbuffer;
+ n[3].i = value[0];
+ if (buffer == GL_COLOR) {
+ n[4].i = value[1];
+ n[5].i = value[2];
+ n[6].i = value[3];
+ }
+ else {
+ n[4].i = 0;
+ n[5].i = 0;
+ n[6].i = 0;
+ }
+ }
+ if (ctx->ExecuteFlag) {
+ /*CALL_ClearBufferiv(ctx->Exec, (buffer, drawbuffer, value));*/
+ }
+}
+
+
+static void GLAPIENTRY
+save_ClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_CLEAR_BUFFER_UIV, 6);
+ if (n) {
+ n[1].e = buffer;
+ n[2].i = drawbuffer;
+ n[3].ui = value[0];
+ if (buffer == GL_COLOR) {
+ n[4].ui = value[1];
+ n[5].ui = value[2];
+ n[6].ui = value[3];
+ }
+ else {
+ n[4].ui = 0;
+ n[5].ui = 0;
+ n[6].ui = 0;
+ }
+ }
+ if (ctx->ExecuteFlag) {
+ /*CALL_ClearBufferuiv(ctx->Exec, (buffer, drawbuffer, value));*/
+ }
+}
+
+
+static void GLAPIENTRY
+save_ClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat *value)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_CLEAR_BUFFER_FV, 6);
+ if (n) {
+ n[1].e = buffer;
+ n[2].i = drawbuffer;
+ n[3].f = value[0];
+ if (buffer == GL_COLOR) {
+ n[4].f = value[1];
+ n[5].f = value[2];
+ n[6].f = value[3];
+ }
+ else {
+ n[4].f = 0.0F;
+ n[5].f = 0.0F;
+ n[6].f = 0.0F;
+ }
+ }
+ if (ctx->ExecuteFlag) {
+ /*CALL_ClearBufferuiv(ctx->Exec, (buffer, drawbuffer, value));*/
+ }
+}
+
+
+static void GLAPIENTRY
+save_ClearBufferfi(GLenum buffer, GLint drawbuffer,
+ GLfloat depth, GLint stencil)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_CLEAR_BUFFER_FI, 4);
+ if (n) {
+ n[1].e = buffer;
+ n[2].i = drawbuffer;
+ n[3].f = depth;
+ n[4].i = stencil;
+ }
+ if (ctx->ExecuteFlag) {
+ /*CALL_ClearBufferfi(ctx->Exec, (buffer, drawbuffer, depth, stencil));*/
+ }
+}
+
+
static void GLAPIENTRY
save_ClearAccum(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_CLEAR_ACCUM, 4);
+ n = alloc_instruction(ctx, OPCODE_CLEAR_ACCUM, 4);
if (n) {
n[1].f = red;
n[2].f = green;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_CLEAR_COLOR, 4);
+ n = alloc_instruction(ctx, OPCODE_CLEAR_COLOR, 4);
if (n) {
n[1].f = red;
n[2].f = green;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_CLEAR_DEPTH, 1);
+ n = alloc_instruction(ctx, OPCODE_CLEAR_DEPTH, 1);
if (n) {
n[1].f = (GLfloat) depth;
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_CLEAR_INDEX, 1);
+ n = alloc_instruction(ctx, OPCODE_CLEAR_INDEX, 1);
if (n) {
n[1].f = c;
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_CLEAR_STENCIL, 1);
+ n = alloc_instruction(ctx, OPCODE_CLEAR_STENCIL, 1);
if (n) {
n[1].i = s;
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_CLIP_PLANE, 5);
+ n = alloc_instruction(ctx, OPCODE_CLIP_PLANE, 5);
if (n) {
n[1].e = plane;
n[2].f = (GLfloat) equ[0];
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_MASK, 4);
+ n = alloc_instruction(ctx, OPCODE_COLOR_MASK, 4);
if (n) {
n[1].b = red;
n[2].b = green;
}
+static void GLAPIENTRY
+save_ColorMaskIndexed(GLuint buf, GLboolean red, GLboolean green,
+ GLboolean blue, GLboolean alpha)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_COLOR_MASK_INDEXED, 5);
+ if (n) {
+ n[1].ui = buf;
+ n[2].b = red;
+ n[3].b = green;
+ n[4].b = blue;
+ n[5].b = alpha;
+ }
+ if (ctx->ExecuteFlag) {
+ /*CALL_ColorMaskIndexedEXT(ctx->Exec, (buf, red, green, blue, alpha));*/
+ }
+}
+
+
static void GLAPIENTRY
save_ColorMaterial(GLenum face, GLenum mode)
{
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_MATERIAL, 2);
+ n = alloc_instruction(ctx, OPCODE_COLOR_MATERIAL, 2);
if (n) {
n[1].e = face;
n[2].e = mode;
else {
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_TABLE, 6);
+ n = alloc_instruction(ctx, OPCODE_COLOR_TABLE, 6);
if (n) {
n[1].e = target;
n[2].e = internalFormat;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_TABLE_PARAMETER_FV, 6);
+ n = alloc_instruction(ctx, OPCODE_COLOR_TABLE_PARAMETER_FV, 6);
if (n) {
n[1].e = target;
n[2].e = pname;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_TABLE_PARAMETER_IV, 6);
+ n = alloc_instruction(ctx, OPCODE_COLOR_TABLE_PARAMETER_IV, 6);
if (n) {
n[1].e = target;
n[2].e = pname;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_SUB_TABLE, 6);
+ n = alloc_instruction(ctx, OPCODE_COLOR_SUB_TABLE, 6);
if (n) {
n[1].e = target;
n[2].i = start;
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_COLOR_SUB_TABLE, 5);
+ n = alloc_instruction(ctx, OPCODE_COPY_COLOR_SUB_TABLE, 5);
if (n) {
n[1].e = target;
n[2].i = start;
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_COLOR_TABLE, 5);
+ n = alloc_instruction(ctx, OPCODE_COPY_COLOR_TABLE, 5);
if (n) {
n[1].e = target;
n[2].e = internalformat;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_FILTER_1D, 6);
+ n = alloc_instruction(ctx, OPCODE_CONVOLUTION_FILTER_1D, 6);
if (n) {
n[1].e = target;
n[2].e = internalFormat;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_FILTER_2D, 7);
+ n = alloc_instruction(ctx, OPCODE_CONVOLUTION_FILTER_2D, 7);
if (n) {
n[1].e = target;
n[2].e = internalFormat;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_PARAMETER_I, 3);
+ n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_I, 3);
if (n) {
n[1].e = target;
n[2].e = pname;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_PARAMETER_IV, 6);
+ n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_IV, 6);
if (n) {
n[1].e = target;
n[2].e = pname;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_PARAMETER_F, 3);
+ n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_F, 3);
if (n) {
n[1].e = target;
n[2].e = pname;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_PARAMETER_FV, 6);
+ n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_FV, 6);
if (n) {
n[1].e = target;
n[2].e = pname;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_PIXELS, 5);
+ n = alloc_instruction(ctx, OPCODE_COPY_PIXELS, 5);
if (n) {
n[1].i = x;
n[2].i = y;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_TEX_IMAGE1D, 7);
+ n = alloc_instruction(ctx, OPCODE_COPY_TEX_IMAGE1D, 7);
if (n) {
n[1].e = target;
n[2].i = level;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_TEX_IMAGE2D, 8);
+ n = alloc_instruction(ctx, OPCODE_COPY_TEX_IMAGE2D, 8);
if (n) {
n[1].e = target;
n[2].i = level;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_TEX_SUB_IMAGE1D, 6);
+ n = alloc_instruction(ctx, OPCODE_COPY_TEX_SUB_IMAGE1D, 6);
if (n) {
n[1].e = target;
n[2].i = level;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_TEX_SUB_IMAGE2D, 8);
+ n = alloc_instruction(ctx, OPCODE_COPY_TEX_SUB_IMAGE2D, 8);
if (n) {
n[1].e = target;
n[2].i = level;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_TEX_SUB_IMAGE3D, 9);
+ n = alloc_instruction(ctx, OPCODE_COPY_TEX_SUB_IMAGE3D, 9);
if (n) {
n[1].e = target;
n[2].i = level;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_CULL_FACE, 1);
+ n = alloc_instruction(ctx, OPCODE_CULL_FACE, 1);
if (n) {
n[1].e = mode;
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_DEPTH_FUNC, 1);
+ n = alloc_instruction(ctx, OPCODE_DEPTH_FUNC, 1);
if (n) {
n[1].e = func;
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_DEPTH_MASK, 1);
+ n = alloc_instruction(ctx, OPCODE_DEPTH_MASK, 1);
if (n) {
n[1].b = mask;
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_DEPTH_RANGE, 2);
+ n = alloc_instruction(ctx, OPCODE_DEPTH_RANGE, 2);
if (n) {
n[1].f = (GLfloat) nearval;
n[2].f = (GLfloat) farval;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_DISABLE, 1);
+ n = alloc_instruction(ctx, OPCODE_DISABLE, 1);
if (n) {
n[1].e = cap;
}
}
+static void GLAPIENTRY
+save_DisableIndexed(GLuint index, GLenum cap)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_DISABLE_INDEXED, 2);
+ if (n) {
+ n[1].ui = index;
+ n[2].e = cap;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_DisableIndexedEXT(ctx->Exec, (index, cap));
+ }
+}
+
+
static void GLAPIENTRY
save_DrawBuffer(GLenum mode)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_DRAW_BUFFER, 1);
+ n = alloc_instruction(ctx, OPCODE_DRAW_BUFFER, 1);
if (n) {
n[1].e = mode;
}
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_DRAW_PIXELS, 5);
+ n = alloc_instruction(ctx, OPCODE_DRAW_PIXELS, 5);
if (n) {
n[1].i = width;
n[2].i = height;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_ENABLE, 1);
+ n = alloc_instruction(ctx, OPCODE_ENABLE, 1);
if (n) {
n[1].e = cap;
}
+static void GLAPIENTRY
+save_EnableIndexed(GLuint index, GLenum cap)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = alloc_instruction(ctx, OPCODE_ENABLE_INDEXED, 2);
+ if (n) {
+ n[1].ui = index;
+ n[2].e = cap;
+ }
+ if (ctx->ExecuteFlag) {
+ CALL_EnableIndexedEXT(ctx->Exec, (index, cap));
+ }
+}
+
+
+
static void GLAPIENTRY
save_EvalMesh1(GLenum mode, GLint i1, GLint i2)
{
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_EVALMESH1, 3);
+ n = alloc_instruction(ctx, OPCODE_EVALMESH1, 3);
if (n) {
n[1].e = mode;
n[2].i = i1;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_EVALMESH2, 5);
+ n = alloc_instruction(ctx, OPCODE_EVALMESH2, 5);
if (n) {
n[1].e = mode;
n[2].i = i1;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_FOG, 5);
+ n = alloc_instruction(ctx, OPCODE_FOG, 5);
if (n) {
n[1].e = pname;
n[2].f = params[0];
case GL_FOG_END:
case GL_FOG_INDEX:
p[0] = (GLfloat) *params;
+ p[1] = 0.0f;
+ p[2] = 0.0f;
+ p[3] = 0.0f;
break;
case GL_FOG_COLOR:
p[0] = INT_TO_FLOAT(params[0]);
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_FRONT_FACE, 1);
+ n = alloc_instruction(ctx, OPCODE_FRONT_FACE, 1);
if (n) {
n[1].e = mode;
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_FRUSTUM, 6);
+ n = alloc_instruction(ctx, OPCODE_FRUSTUM, 6);
if (n) {
n[1].f = (GLfloat) left;
n[2].f = (GLfloat) right;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_HINT, 2);
+ n = alloc_instruction(ctx, OPCODE_HINT, 2);
if (n) {
n[1].e = target;
n[2].e = mode;
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_HISTOGRAM, 4);
+ n = alloc_instruction(ctx, OPCODE_HISTOGRAM, 4);
if (n) {
n[1].e = target;
n[2].i = width;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_INDEX_MASK, 1);
+ n = alloc_instruction(ctx, OPCODE_INDEX_MASK, 1);
if (n) {
n[1].ui = mask;
}
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- (void) ALLOC_INSTRUCTION(ctx, OPCODE_INIT_NAMES, 0);
+ (void) alloc_instruction(ctx, OPCODE_INIT_NAMES, 0);
if (ctx->ExecuteFlag) {
CALL_InitNames(ctx->Exec, ());
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_LIGHT, 6);
+ n = alloc_instruction(ctx, OPCODE_LIGHT, 6);
if (n) {
GLint i, nParams;
n[1].e = light;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_LIGHT_MODEL, 5);
+ n = alloc_instruction(ctx, OPCODE_LIGHT_MODEL, 5);
if (n) {
n[1].e = pname;
n[2].f = params[0];
case GL_LIGHT_MODEL_TWO_SIDE:
case GL_LIGHT_MODEL_COLOR_CONTROL:
fparam[0] = (GLfloat) params[0];
+ fparam[1] = 0.0F;
+ fparam[2] = 0.0F;
+ fparam[3] = 0.0F;
break;
default:
/* Error will be caught later in gl_LightModelfv */
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_LINE_STIPPLE, 2);
+ n = alloc_instruction(ctx, OPCODE_LINE_STIPPLE, 2);
if (n) {
n[1].i = factor;
n[2].us = pattern;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_LINE_WIDTH, 1);
+ n = alloc_instruction(ctx, OPCODE_LINE_WIDTH, 1);
if (n) {
n[1].f = width;
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_LIST_BASE, 1);
+ n = alloc_instruction(ctx, OPCODE_LIST_BASE, 1);
if (n) {
n[1].ui = base;
}
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- (void) ALLOC_INSTRUCTION(ctx, OPCODE_LOAD_IDENTITY, 0);
+ (void) alloc_instruction(ctx, OPCODE_LOAD_IDENTITY, 0);
if (ctx->ExecuteFlag) {
CALL_LoadIdentity(ctx->Exec, ());
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_LOAD_MATRIX, 16);
+ n = alloc_instruction(ctx, OPCODE_LOAD_MATRIX, 16);
if (n) {
GLuint i;
for (i = 0; i < 16; i++) {
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_LOAD_NAME, 1);
+ n = alloc_instruction(ctx, OPCODE_LOAD_NAME, 1);
if (n) {
n[1].ui = name;
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_LOGIC_OP, 1);
+ n = alloc_instruction(ctx, OPCODE_LOGIC_OP, 1);
if (n) {
n[1].e = opcode;
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_MAP1, 6);
+ n = alloc_instruction(ctx, OPCODE_MAP1, 6);
if (n) {
GLfloat *pnts = _mesa_copy_map_points1d(target, stride, order, points);
n[1].e = target;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_MAP1, 6);
+ n = alloc_instruction(ctx, OPCODE_MAP1, 6);
if (n) {
GLfloat *pnts = _mesa_copy_map_points1f(target, stride, order, points);
n[1].e = target;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_MAP2, 10);
+ n = alloc_instruction(ctx, OPCODE_MAP2, 10);
if (n) {
GLfloat *pnts = _mesa_copy_map_points2d(target, ustride, uorder,
vstride, vorder, points);
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_MAP2, 10);
+ n = alloc_instruction(ctx, OPCODE_MAP2, 10);
if (n) {
GLfloat *pnts = _mesa_copy_map_points2f(target, ustride, uorder,
vstride, vorder, points);
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_MAPGRID1, 3);
+ n = alloc_instruction(ctx, OPCODE_MAPGRID1, 3);
if (n) {
n[1].i = un;
n[2].f = u1;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_MAPGRID2, 6);
+ n = alloc_instruction(ctx, OPCODE_MAPGRID2, 6);
if (n) {
n[1].i = un;
n[2].f = u1;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_MATRIX_MODE, 1);
+ n = alloc_instruction(ctx, OPCODE_MATRIX_MODE, 1);
if (n) {
n[1].e = mode;
}
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_MIN_MAX, 3);
+ n = alloc_instruction(ctx, OPCODE_MIN_MAX, 3);
if (n) {
n[1].e = target;
n[2].e = internalFormat;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_MULT_MATRIX, 16);
+ n = alloc_instruction(ctx, OPCODE_MULT_MATRIX, 16);
if (n) {
GLuint i;
for (i = 0; i < 16; i++) {
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_ORTHO, 6);
+ n = alloc_instruction(ctx, OPCODE_ORTHO, 6);
if (n) {
n[1].f = (GLfloat) left;
n[2].f = (GLfloat) right;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_PIXEL_MAP, 3);
+ n = alloc_instruction(ctx, OPCODE_PIXEL_MAP, 3);
if (n) {
n[1].e = map;
n[2].i = mapsize;
- n[3].data = (void *) _mesa_malloc(mapsize * sizeof(GLfloat));
- MEMCPY(n[3].data, (void *) values, mapsize * sizeof(GLfloat));
+ n[3].data = (void *) malloc(mapsize * sizeof(GLfloat));
+ memcpy(n[3].data, (void *) values, mapsize * sizeof(GLfloat));
}
if (ctx->ExecuteFlag) {
CALL_PixelMapfv(ctx->Exec, (map, mapsize, values));
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_PIXEL_TRANSFER, 2);
+ n = alloc_instruction(ctx, OPCODE_PIXEL_TRANSFER, 2);
if (n) {
n[1].e = pname;
n[2].f = param;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_PIXEL_ZOOM, 2);
+ n = alloc_instruction(ctx, OPCODE_PIXEL_ZOOM, 2);
if (n) {
n[1].f = xfactor;
n[2].f = yfactor;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_POINT_PARAMETERS, 4);
+ n = alloc_instruction(ctx, OPCODE_POINT_PARAMETERS, 4);
if (n) {
n[1].e = pname;
n[2].f = params[0];
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_POINT_SIZE, 1);
+ n = alloc_instruction(ctx, OPCODE_POINT_SIZE, 1);
if (n) {
n[1].f = size;
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_POLYGON_MODE, 2);
+ n = alloc_instruction(ctx, OPCODE_POLYGON_MODE, 2);
if (n) {
n[1].e = face;
n[2].e = mode;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_POLYGON_STIPPLE, 1);
+ n = alloc_instruction(ctx, OPCODE_POLYGON_STIPPLE, 1);
if (n) {
n[1].data = unpack_image(ctx, 2, 32, 32, 1, GL_COLOR_INDEX, GL_BITMAP,
pattern, &ctx->Unpack);
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_POLYGON_OFFSET, 2);
+ n = alloc_instruction(ctx, OPCODE_POLYGON_OFFSET, 2);
if (n) {
n[1].f = factor;
n[2].f = units;
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- (void) ALLOC_INSTRUCTION(ctx, OPCODE_POP_ATTRIB, 0);
+ (void) alloc_instruction(ctx, OPCODE_POP_ATTRIB, 0);
if (ctx->ExecuteFlag) {
CALL_PopAttrib(ctx->Exec, ());
}
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- (void) ALLOC_INSTRUCTION(ctx, OPCODE_POP_MATRIX, 0);
+ (void) alloc_instruction(ctx, OPCODE_POP_MATRIX, 0);
if (ctx->ExecuteFlag) {
CALL_PopMatrix(ctx->Exec, ());
}
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- (void) ALLOC_INSTRUCTION(ctx, OPCODE_POP_NAME, 0);
+ (void) alloc_instruction(ctx, OPCODE_POP_NAME, 0);
if (ctx->ExecuteFlag) {
CALL_PopName(ctx->Exec, ());
}
for (i = 0; i < num; i++) {
Node *n;
- n = ALLOC_INSTRUCTION(ctx, OPCODE_PRIORITIZE_TEXTURE, 2);
+ n = alloc_instruction(ctx, OPCODE_PRIORITIZE_TEXTURE, 2);
if (n) {
n[1].ui = textures[i];
n[2].f = priorities[i];
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_PUSH_ATTRIB, 1);
+ n = alloc_instruction(ctx, OPCODE_PUSH_ATTRIB, 1);
if (n) {
n[1].bf = mask;
}
{
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- (void) ALLOC_INSTRUCTION(ctx, OPCODE_PUSH_MATRIX, 0);
+ (void) alloc_instruction(ctx, OPCODE_PUSH_MATRIX, 0);
if (ctx->ExecuteFlag) {
CALL_PushMatrix(ctx->Exec, ());
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_PUSH_NAME, 1);
+ n = alloc_instruction(ctx, OPCODE_PUSH_NAME, 1);
if (n) {
n[1].ui = name;
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_RASTER_POS, 4);
+ n = alloc_instruction(ctx, OPCODE_RASTER_POS, 4);
if (n) {
n[1].f = x;
n[2].f = y;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_PASSTHROUGH, 1);
+ n = alloc_instruction(ctx, OPCODE_PASSTHROUGH, 1);
if (n) {
n[1].f = token;
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_READ_BUFFER, 1);
+ n = alloc_instruction(ctx, OPCODE_READ_BUFFER, 1);
if (n) {
n[1].e = mode;
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_RESET_HISTOGRAM, 1);
+ n = alloc_instruction(ctx, OPCODE_RESET_HISTOGRAM, 1);
if (n) {
n[1].e = target;
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_RESET_MIN_MAX, 1);
+ n = alloc_instruction(ctx, OPCODE_RESET_MIN_MAX, 1);
if (n) {
n[1].e = target;
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_ROTATE, 4);
+ n = alloc_instruction(ctx, OPCODE_ROTATE, 4);
if (n) {
n[1].f = angle;
n[2].f = x;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_SCALE, 3);
+ n = alloc_instruction(ctx, OPCODE_SCALE, 3);
if (n) {
n[1].f = x;
n[2].f = y;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_SCISSOR, 4);
+ n = alloc_instruction(ctx, OPCODE_SCISSOR, 4);
if (n) {
n[1].i = x;
n[2].i = y;
if (ctx->Driver.CurrentSavePrimitive == PRIM_OUTSIDE_BEGIN_END)
ctx->ListState.Current.ShadeModel = mode;
- n = ALLOC_INSTRUCTION(ctx, OPCODE_SHADE_MODEL, 1);
+ n = alloc_instruction(ctx, OPCODE_SHADE_MODEL, 1);
if (n) {
n[1].e = mode;
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_FUNC, 3);
+ n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC, 3);
if (n) {
n[1].e = func;
n[2].i = ref;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_MASK, 1);
+ n = alloc_instruction(ctx, OPCODE_STENCIL_MASK, 1);
if (n) {
n[1].ui = mask;
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_OP, 3);
+ n = alloc_instruction(ctx, OPCODE_STENCIL_OP, 3);
if (n) {
n[1].e = fail;
n[2].e = zfail;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4);
+ n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4);
if (n) {
n[1].e = face;
n[2].e = func;
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
/* GL_FRONT */
- n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4);
+ n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4);
if (n) {
n[1].e = GL_FRONT;
n[2].e = frontfunc;
n[4].ui = mask;
}
/* GL_BACK */
- n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4);
+ n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4);
if (n) {
n[1].e = GL_BACK;
n[2].e = backfunc;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_MASK_SEPARATE, 2);
+ n = alloc_instruction(ctx, OPCODE_STENCIL_MASK_SEPARATE, 2);
if (n) {
n[1].e = face;
n[2].ui = mask;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_OP_SEPARATE, 4);
+ n = alloc_instruction(ctx, OPCODE_STENCIL_OP_SEPARATE, 4);
if (n) {
n[1].e = face;
n[2].e = fail;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_TEXENV, 6);
+ n = alloc_instruction(ctx, OPCODE_TEXENV, 6);
if (n) {
n[1].e = target;
n[2].e = pname;
{
GLfloat p[4];
p[0] = (GLfloat) param;
- p[1] = p[2] = p[3] = 0.0;
+ p[1] = p[2] = p[3] = 0.0F;
save_TexEnvfv(target, pname, p);
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_TEXGEN, 6);
+ n = alloc_instruction(ctx, OPCODE_TEXGEN, 6);
if (n) {
n[1].e = coord;
n[2].e = pname;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_TEXPARAMETER, 6);
+ n = alloc_instruction(ctx, OPCODE_TEXPARAMETER, 6);
if (n) {
n[1].e = target;
n[2].e = pname;
{
GLfloat fparam[4];
fparam[0] = (GLfloat) param;
- fparam[1] = fparam[2] = fparam[3] = 0.0;
+ fparam[1] = fparam[2] = fparam[3] = 0.0F;
save_TexParameterfv(target, pname, fparam);
}
{
GLfloat fparam[4];
fparam[0] = (GLfloat) params[0];
- fparam[1] = fparam[2] = fparam[3] = 0.0;
+ fparam[1] = fparam[2] = fparam[3] = 0.0F;
save_TexParameterfv(target, pname, fparam);
}
else {
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_IMAGE1D, 8);
+ n = alloc_instruction(ctx, OPCODE_TEX_IMAGE1D, 8);
if (n) {
n[1].e = target;
n[2].i = level;
else {
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_IMAGE2D, 9);
+ n = alloc_instruction(ctx, OPCODE_TEX_IMAGE2D, 9);
if (n) {
n[1].e = target;
n[2].i = level;
else {
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_IMAGE3D, 10);
+ n = alloc_instruction(ctx, OPCODE_TEX_IMAGE3D, 10);
if (n) {
n[1].e = target;
n[2].i = level;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_SUB_IMAGE1D, 7);
+ n = alloc_instruction(ctx, OPCODE_TEX_SUB_IMAGE1D, 7);
if (n) {
n[1].e = target;
n[2].i = level;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_SUB_IMAGE2D, 9);
+ n = alloc_instruction(ctx, OPCODE_TEX_SUB_IMAGE2D, 9);
if (n) {
n[1].e = target;
n[2].i = level;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_SUB_IMAGE3D, 11);
+ n = alloc_instruction(ctx, OPCODE_TEX_SUB_IMAGE3D, 11);
if (n) {
n[1].e = target;
n[2].i = level;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_TRANSLATE, 3);
+ n = alloc_instruction(ctx, OPCODE_TRANSLATE, 3);
if (n) {
n[1].f = x;
n[2].f = y;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_VIEWPORT, 4);
+ n = alloc_instruction(ctx, OPCODE_VIEWPORT, 4);
if (n) {
n[1].i = x;
n[2].i = y;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_WINDOW_POS, 4);
+ n = alloc_instruction(ctx, OPCODE_WINDOW_POS, 4);
if (n) {
n[1].f = x;
n[2].f = y;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_ACTIVE_TEXTURE, 1);
+ n = alloc_instruction(ctx, OPCODE_ACTIVE_TEXTURE, 1);
if (n) {
n[1].e = target;
}
GLvoid *image;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
/* make copy of image */
- image = _mesa_malloc(imageSize);
+ image = malloc(imageSize);
if (!image) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage1DARB");
return;
}
- MEMCPY(image, data, imageSize);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_IMAGE_1D, 7);
+ memcpy(image, data, imageSize);
+ n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_1D, 7);
if (n) {
n[1].e = target;
n[2].i = level;
n[7].data = image;
}
else if (image) {
- _mesa_free(image);
+ free(image);
}
if (ctx->ExecuteFlag) {
CALL_CompressedTexImage1DARB(ctx->Exec,
GLvoid *image;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
/* make copy of image */
- image = _mesa_malloc(imageSize);
+ image = malloc(imageSize);
if (!image) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2DARB");
return;
}
- MEMCPY(image, data, imageSize);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_IMAGE_2D, 8);
+ memcpy(image, data, imageSize);
+ n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_2D, 8);
if (n) {
n[1].e = target;
n[2].i = level;
n[8].data = image;
}
else if (image) {
- _mesa_free(image);
+ free(image);
}
if (ctx->ExecuteFlag) {
CALL_CompressedTexImage2DARB(ctx->Exec,
GLvoid *image;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
/* make copy of image */
- image = _mesa_malloc(imageSize);
+ image = malloc(imageSize);
if (!image) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage3DARB");
return;
}
- MEMCPY(image, data, imageSize);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_IMAGE_3D, 9);
+ memcpy(image, data, imageSize);
+ n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_3D, 9);
if (n) {
n[1].e = target;
n[2].i = level;
n[9].data = image;
}
else if (image) {
- _mesa_free(image);
+ free(image);
}
if (ctx->ExecuteFlag) {
CALL_CompressedTexImage3DARB(ctx->Exec,
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
/* make copy of image */
- image = _mesa_malloc(imageSize);
+ image = malloc(imageSize);
if (!image) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage1DARB");
return;
}
- MEMCPY(image, data, imageSize);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D, 7);
+ memcpy(image, data, imageSize);
+ n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D, 7);
if (n) {
n[1].e = target;
n[2].i = level;
n[7].data = image;
}
else if (image) {
- _mesa_free(image);
+ free(image);
}
if (ctx->ExecuteFlag) {
CALL_CompressedTexSubImage1DARB(ctx->Exec, (target, level, xoffset,
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
/* make copy of image */
- image = _mesa_malloc(imageSize);
+ image = malloc(imageSize);
if (!image) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage2DARB");
return;
}
- MEMCPY(image, data, imageSize);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D, 9);
+ memcpy(image, data, imageSize);
+ n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D, 9);
if (n) {
n[1].e = target;
n[2].i = level;
n[9].data = image;
}
else if (image) {
- _mesa_free(image);
+ free(image);
}
if (ctx->ExecuteFlag) {
CALL_CompressedTexSubImage2DARB(ctx->Exec,
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
/* make copy of image */
- image = _mesa_malloc(imageSize);
+ image = malloc(imageSize);
if (!image) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexSubImage3DARB");
return;
}
- MEMCPY(image, data, imageSize);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D, 11);
+ memcpy(image, data, imageSize);
+ n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D, 11);
if (n) {
n[1].e = target;
n[2].i = level;
n[11].data = image;
}
else if (image) {
- _mesa_free(image);
+ free(image);
}
if (ctx->ExecuteFlag) {
CALL_CompressedTexSubImage3DARB(ctx->Exec,
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_SAMPLE_COVERAGE, 2);
+ n = alloc_instruction(ctx, OPCODE_SAMPLE_COVERAGE, 2);
if (n) {
n[1].f = value;
n[2].b = invert;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_BIND_PROGRAM_NV, 2);
+ n = alloc_instruction(ctx, OPCODE_BIND_PROGRAM_NV, 2);
if (n) {
n[1].e = target;
n[2].ui = id;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6);
+ n = alloc_instruction(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6);
if (n) {
n[1].e = target;
n[2].ui = index;
const GLfloat * p = params;
for (i = 0 ; i < count ; i++) {
- n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6);
+ n = alloc_instruction(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6);
if (n) {
n[1].e = target;
n[2].ui = index;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_EXECUTE_PROGRAM_NV, 6);
+ n = alloc_instruction(ctx, OPCODE_EXECUTE_PROGRAM_NV, 6);
if (n) {
n[1].e = target;
n[2].ui = id;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_LOAD_PROGRAM_NV, 4);
+ n = alloc_instruction(ctx, OPCODE_LOAD_PROGRAM_NV, 4);
if (n) {
- GLubyte *programCopy = (GLubyte *) _mesa_malloc(len);
+ GLubyte *programCopy = (GLubyte *) malloc(len);
if (!programCopy) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV");
return;
}
- _mesa_memcpy(programCopy, program, len);
+ memcpy(programCopy, program, len);
n[1].e = target;
n[2].ui = id;
n[3].i = len;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_TRACK_MATRIX_NV, 2);
+ n = alloc_instruction(ctx, OPCODE_TRACK_MATRIX_NV, 2);
if (n) {
- GLuint *idCopy = (GLuint *) _mesa_malloc(num * sizeof(GLuint));
+ GLuint *idCopy = (GLuint *) malloc(num * sizeof(GLuint));
if (!idCopy) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glRequestResidentProgramsNV");
return;
}
- _mesa_memcpy(idCopy, ids, num * sizeof(GLuint));
+ memcpy(idCopy, ids, num * sizeof(GLuint));
n[1].i = num;
n[2].data = idCopy;
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_TRACK_MATRIX_NV, 4);
+ n = alloc_instruction(ctx, OPCODE_TRACK_MATRIX_NV, 4);
if (n) {
n[1].e = target;
n[2].ui = address;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
+ n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
if (n) {
n[1].e = target;
n[2].ui = index;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
+ n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
if (n) {
n[1].e = target;
n[2].ui = index;
const GLfloat * p = params;
for (i = 0 ; i < count ; i++) {
- n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
+ n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
if (n) {
n[1].e = target;
n[2].ui = index;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
+ n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
if (n) {
n[1].e = target;
n[2].ui = index;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
+ n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
if (n) {
n[1].e = target;
n[2].ui = index;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_NAMED_PARAMETER_NV, 6);
+ n = alloc_instruction(ctx, OPCODE_PROGRAM_NAMED_PARAMETER_NV, 6);
if (n) {
- GLubyte *nameCopy = (GLubyte *) _mesa_malloc(len);
+ GLubyte *nameCopy = (GLubyte *) malloc(len);
if (!nameCopy) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramNamedParameter4fNV");
return;
}
- _mesa_memcpy(nameCopy, name, len);
+ memcpy(nameCopy, name, len);
n[1].ui = id;
n[2].i = len;
n[3].data = nameCopy;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_ACTIVE_STENCIL_FACE_EXT, 1);
+ n = alloc_instruction(ctx, OPCODE_ACTIVE_STENCIL_FACE_EXT, 1);
if (n) {
n[1].e = face;
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_DEPTH_BOUNDS_EXT, 2);
+ n = alloc_instruction(ctx, OPCODE_DEPTH_BOUNDS_EXT, 2);
if (n) {
n[1].f = (GLfloat) zmin;
n[2].f = (GLfloat) zmax;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_STRING_ARB, 4);
+ n = alloc_instruction(ctx, OPCODE_PROGRAM_STRING_ARB, 4);
if (n) {
- GLubyte *programCopy = (GLubyte *) _mesa_malloc(len);
+ GLubyte *programCopy = (GLubyte *) malloc(len);
if (!programCopy) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramStringARB");
return;
}
- _mesa_memcpy(programCopy, string, len);
+ memcpy(programCopy, string, len);
n[1].e = target;
n[2].e = format;
n[3].i = len;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_BEGIN_QUERY_ARB, 2);
+ n = alloc_instruction(ctx, OPCODE_BEGIN_QUERY_ARB, 2);
if (n) {
n[1].e = target;
n[2].ui = id;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_END_QUERY_ARB, 1);
+ n = alloc_instruction(ctx, OPCODE_END_QUERY_ARB, 1);
if (n) {
n[1].e = target;
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_DRAW_BUFFERS_ARB, 1 + MAX_DRAW_BUFFERS);
+ n = alloc_instruction(ctx, OPCODE_DRAW_BUFFERS_ARB, 1 + MAX_DRAW_BUFFERS);
if (n) {
GLint i;
n[1].i = count;
GET_CURRENT_CONTEXT(ctx);
Node *n;
- n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_BUMP_PARAMETER_ATI, 5);
+ n = alloc_instruction(ctx, OPCODE_TEX_BUMP_PARAMETER_ATI, 5);
if (n) {
n[1].ui = pname;
n[2].f = param[0];
GET_CURRENT_CONTEXT(ctx);
Node *n;
- n = ALLOC_INSTRUCTION(ctx, OPCODE_BIND_FRAGMENT_SHADER_ATI, 1);
+ n = alloc_instruction(ctx, OPCODE_BIND_FRAGMENT_SHADER_ATI, 1);
if (n) {
n[1].ui = id;
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
- n = ALLOC_INSTRUCTION(ctx, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI, 5);
+ n = alloc_instruction(ctx, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI, 5);
if (n) {
n[1].ui = dst;
n[2].f = value[0];
GET_CURRENT_CONTEXT(ctx);
Node *n;
SAVE_FLUSH_VERTICES(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_1F_NV, 2);
+ n = alloc_instruction(ctx, OPCODE_ATTR_1F_NV, 2);
if (n) {
n[1].e = attr;
n[2].f = x;
GET_CURRENT_CONTEXT(ctx);
Node *n;
SAVE_FLUSH_VERTICES(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_2F_NV, 3);
+ n = alloc_instruction(ctx, OPCODE_ATTR_2F_NV, 3);
if (n) {
n[1].e = attr;
n[2].f = x;
GET_CURRENT_CONTEXT(ctx);
Node *n;
SAVE_FLUSH_VERTICES(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_3F_NV, 4);
+ n = alloc_instruction(ctx, OPCODE_ATTR_3F_NV, 4);
if (n) {
n[1].e = attr;
n[2].f = x;
GET_CURRENT_CONTEXT(ctx);
Node *n;
SAVE_FLUSH_VERTICES(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_4F_NV, 5);
+ n = alloc_instruction(ctx, OPCODE_ATTR_4F_NV, 5);
if (n) {
n[1].e = attr;
n[2].f = x;
GET_CURRENT_CONTEXT(ctx);
Node *n;
SAVE_FLUSH_VERTICES(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_1F_ARB, 2);
+ n = alloc_instruction(ctx, OPCODE_ATTR_1F_ARB, 2);
if (n) {
n[1].e = attr;
n[2].f = x;
GET_CURRENT_CONTEXT(ctx);
Node *n;
SAVE_FLUSH_VERTICES(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_2F_ARB, 3);
+ n = alloc_instruction(ctx, OPCODE_ATTR_2F_ARB, 3);
if (n) {
n[1].e = attr;
n[2].f = x;
GET_CURRENT_CONTEXT(ctx);
Node *n;
SAVE_FLUSH_VERTICES(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_3F_ARB, 4);
+ n = alloc_instruction(ctx, OPCODE_ATTR_3F_ARB, 4);
if (n) {
n[1].e = attr;
n[2].f = x;
GET_CURRENT_CONTEXT(ctx);
Node *n;
SAVE_FLUSH_VERTICES(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_4F_ARB, 5);
+ n = alloc_instruction(ctx, OPCODE_ATTR_4F_ARB, 5);
if (n) {
n[1].e = attr;
n[2].f = x;
GET_CURRENT_CONTEXT(ctx);
Node *n;
SAVE_FLUSH_VERTICES(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_EVAL_C1, 1);
+ n = alloc_instruction(ctx, OPCODE_EVAL_C1, 1);
if (n) {
n[1].f = x;
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
SAVE_FLUSH_VERTICES(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_EVAL_C2, 2);
+ n = alloc_instruction(ctx, OPCODE_EVAL_C2, 2);
if (n) {
n[1].f = x;
n[2].f = y;
GET_CURRENT_CONTEXT(ctx);
Node *n;
SAVE_FLUSH_VERTICES(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_EVAL_P1, 1);
+ n = alloc_instruction(ctx, OPCODE_EVAL_P1, 1);
if (n) {
n[1].i = x;
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
SAVE_FLUSH_VERTICES(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_EVAL_P2, 2);
+ n = alloc_instruction(ctx, OPCODE_EVAL_P2, 2);
if (n) {
n[1].i = x;
n[2].i = y;
SAVE_FLUSH_VERTICES(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_MATERIAL, 6);
+ n = alloc_instruction(ctx, OPCODE_MATERIAL, 6);
if (n) {
n[1].e = face;
n[2].e = pname;
return;
SAVE_FLUSH_VERTICES(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_BEGIN, 1);
+ n = alloc_instruction(ctx, OPCODE_BEGIN, 1);
if (n) {
n[1].e = mode;
}
{
GET_CURRENT_CONTEXT(ctx);
SAVE_FLUSH_VERTICES(ctx);
- (void) ALLOC_INSTRUCTION(ctx, OPCODE_END, 0);
+ (void) alloc_instruction(ctx, OPCODE_END, 0);
ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END;
if (ctx->ExecuteFlag) {
CALL_End(ctx->Exec, ());
GET_CURRENT_CONTEXT(ctx);
Node *n;
SAVE_FLUSH_VERTICES(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_RECTF, 4);
+ n = alloc_instruction(ctx, OPCODE_RECTF, 4);
if (n) {
n[1].f = a;
n[2].f = b;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_BLIT_FRAMEBUFFER, 10);
+ n = alloc_instruction(ctx, OPCODE_BLIT_FRAMEBUFFER, 10);
if (n) {
n[1].i = srcX0;
n[2].i = srcY0;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_PROVOKING_VERTEX, 1);
+ n = alloc_instruction(ctx, OPCODE_PROVOKING_VERTEX, 1);
if (n) {
n[1].e = mode;
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_USE_PROGRAM, 1);
+ n = alloc_instruction(ctx, OPCODE_USE_PROGRAM, 1);
if (n) {
n[1].ui = program;
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_1F, 2);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_1F, 2);
if (n) {
n[1].i = location;
n[2].f = x;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_2F, 3);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_2F, 3);
if (n) {
n[1].i = location;
n[2].f = x;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_3F, 4);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_3F, 4);
if (n) {
n[1].i = location;
n[2].f = x;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_4F, 5);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_4F, 5);
if (n) {
n[1].i = location;
n[2].f = x;
static void *
memdup(const void *src, GLsizei bytes)
{
- void *b = bytes >= 0 ? _mesa_malloc(bytes) : NULL;
+ void *b = bytes >= 0 ? malloc(bytes) : NULL;
if (b)
- _mesa_memcpy(b, src, bytes);
+ memcpy(b, src, bytes);
return b;
}
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_1FV, 3);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_1FV, 3);
if (n) {
n[1].i = location;
n[2].i = count;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_2FV, 3);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_2FV, 3);
if (n) {
n[1].i = location;
n[2].i = count;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_3FV, 3);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_3FV, 3);
if (n) {
n[1].i = location;
n[2].i = count;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_4FV, 3);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_4FV, 3);
if (n) {
n[1].i = location;
n[2].i = count;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_1I, 2);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_1I, 2);
if (n) {
n[1].i = location;
n[2].i = x;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_2I, 3);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_2I, 3);
if (n) {
n[1].i = location;
n[2].i = x;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_3I, 4);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_3I, 4);
if (n) {
n[1].i = location;
n[2].i = x;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_4I, 5);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_4I, 5);
if (n) {
n[1].i = location;
n[2].i = x;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_1IV, 3);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_1IV, 3);
if (n) {
n[1].i = location;
n[2].i = count;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_2IV, 3);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_2IV, 3);
if (n) {
n[1].i = location;
n[2].i = count;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_3IV, 3);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_3IV, 3);
if (n) {
n[1].i = location;
n[2].i = count;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_4IV, 3);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_4IV, 3);
if (n) {
n[1].i = location;
n[2].i = count;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX22, 4);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX22, 4);
if (n) {
n[1].i = location;
n[2].i = count;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX33, 4);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX33, 4);
if (n) {
n[1].i = location;
n[2].i = count;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX44, 4);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX44, 4);
if (n) {
n[1].i = location;
n[2].i = count;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX23, 4);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX23, 4);
if (n) {
n[1].i = location;
n[2].i = count;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX32, 4);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX32, 4);
if (n) {
n[1].i = location;
n[2].i = count;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX24, 4);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX24, 4);
if (n) {
n[1].i = location;
n[2].i = count;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX42, 4);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX42, 4);
if (n) {
n[1].i = location;
n[2].i = count;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX34, 4);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX34, 4);
if (n) {
n[1].i = location;
n[2].i = count;
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
- n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX43, 4);
+ n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX43, 4);
if (n) {
n[1].i = location;
n[2].i = count;
save_error(GLcontext *ctx, GLenum error, const char *s)
{
Node *n;
- n = ALLOC_INSTRUCTION(ctx, OPCODE_ERROR, 2);
+ n = alloc_instruction(ctx, OPCODE_ERROR, 2);
if (n) {
n[1].e = error;
n[2].data = (void *) s;
done = GL_FALSE;
while (!done) {
- OpCode opcode = n[0].opcode;
- int i = (int) n[0].opcode - (int) OPCODE_EXT_0;
+ const OpCode opcode = n[0].opcode;
- if (i >= 0 && i < (GLint) ctx->ListExt.NumOpcodes) {
- /* this is a driver-extended opcode */
- ctx->ListExt.Opcode[i].Execute(ctx, &n[1]);
- n += ctx->ListExt.Opcode[i].Size;
+ if (is_ext_opcode(opcode)) {
+ n += ext_opcode_execute(ctx, n);
}
else {
switch (opcode) {
case OPCODE_CLEAR:
CALL_Clear(ctx->Exec, (n[1].bf));
break;
+ case OPCODE_CLEAR_BUFFER_IV:
+ {
+ GLint value[4];
+ value[0] = n[3].i;
+ value[1] = n[4].i;
+ value[2] = n[5].i;
+ value[3] = n[6].i;
+ /*CALL_ClearBufferiv(ctx->Exec, (n[1].e, n[2].i, value));*/
+ }
+ break;
+ case OPCODE_CLEAR_BUFFER_UIV:
+ {
+ GLuint value[4];
+ value[0] = n[3].ui;
+ value[1] = n[4].ui;
+ value[2] = n[5].ui;
+ value[3] = n[6].ui;
+ /*CALL_ClearBufferiv(ctx->Exec, (n[1].e, n[2].i, value));*/
+ }
+ break;
+ case OPCODE_CLEAR_BUFFER_FV:
+ {
+ GLfloat value[4];
+ value[0] = n[3].f;
+ value[1] = n[4].f;
+ value[2] = n[5].f;
+ value[3] = n[6].f;
+ /*CALL_ClearBufferfv(ctx->Exec, (n[1].e, n[2].i, value));*/
+ }
+ break;
+ case OPCODE_CLEAR_BUFFER_FI:
+ /*CALL_ClearBufferfi(ctx->Exec, (n[1].e, n[2].i, n[3].f, n[4].i));*/
+ break;
case OPCODE_CLEAR_COLOR:
CALL_ClearColor(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
break;
case OPCODE_COLOR_MASK:
CALL_ColorMask(ctx->Exec, (n[1].b, n[2].b, n[3].b, n[4].b));
break;
+ case OPCODE_COLOR_MASK_INDEXED:
+ CALL_ColorMaskIndexedEXT(ctx->Exec, (n[1].ui, n[2].b, n[3].b,
+ n[4].b, n[5].b));
+ break;
case OPCODE_COLOR_MATERIAL:
CALL_ColorMaterial(ctx->Exec, (n[1].e, n[2].e));
break;
case OPCODE_DISABLE:
CALL_Disable(ctx->Exec, (n[1].e));
break;
+ case OPCODE_DISABLE_INDEXED:
+ CALL_DisableIndexedEXT(ctx->Exec, (n[1].ui, n[2].e));
+ break;
case OPCODE_DRAW_BUFFER:
CALL_DrawBuffer(ctx->Exec, (n[1].e));
break;
case OPCODE_ENABLE:
CALL_Enable(ctx->Exec, (n[1].e));
break;
+ case OPCODE_ENABLE_INDEXED:
+ CALL_EnableIndexedEXT(ctx->Exec, (n[1].ui, n[2].e));
+ break;
case OPCODE_EVALMESH1:
CALL_EvalMesh1(ctx->Exec, (n[1].e, n[2].i, n[3].i));
break;
default:
{
char msg[1000];
- _mesa_sprintf(msg, "Error in execute_list: opcode=%d",
+ sprintf(msg, "Error in execute_list: opcode=%d",
(int) opcode);
_mesa_problem(ctx, msg);
}
*/
ctx->Driver.EndList(ctx);
- (void) ALLOC_INSTRUCTION(ctx, OPCODE_END_OF_LIST, 0);
+ (void) alloc_instruction(ctx, OPCODE_END_OF_LIST, 0);
/* Destroy old list, if any */
destroy_list(ctx, ctx->ListState.CurrentList->Name);
SET_ClearStencil(table, save_ClearStencil);
SET_ClipPlane(table, save_ClipPlane);
SET_ColorMask(table, save_ColorMask);
+ SET_ColorMaskIndexedEXT(table, save_ColorMaskIndexed);
SET_ColorMaterial(table, save_ColorMaterial);
SET_CopyPixels(table, save_CopyPixels);
SET_CullFace(table, save_CullFace);
SET_DepthMask(table, save_DepthMask);
SET_DepthRange(table, save_DepthRange);
SET_Disable(table, save_Disable);
+ SET_DisableIndexedEXT(table, save_DisableIndexed);
SET_DrawBuffer(table, save_DrawBuffer);
SET_DrawPixels(table, save_DrawPixels);
SET_Enable(table, save_Enable);
+ SET_EnableIndexedEXT(table, save_EnableIndexed);
SET_EndList(table, _mesa_EndList);
SET_EvalMesh1(table, save_EvalMesh1);
SET_EvalMesh2(table, save_EvalMesh2);
/* 364. GL_EXT_provoking_vertex */
SET_ProvokingVertexEXT(table, save_ProvokingVertexEXT);
+
+ /* 371. GL_APPLE_object_purgeable */
+#if FEATURE_APPLE_object_purgeable
+ SET_ObjectPurgeableAPPLE(table, _mesa_ObjectPurgeableAPPLE);
+ SET_ObjectUnpurgeableAPPLE(table, _mesa_ObjectUnpurgeableAPPLE);
+#endif
+
+ /* GL 3.0 */
+#if 0
+ SET_ClearBufferiv(table, save_ClearBufferiv);
+ SET_ClearBufferuiv(table, save_ClearBufferuiv);
+ SET_ClearBufferfv(table, save_ClearBufferfv);
+ SET_ClearBufferfi(table, save_ClearBufferfi);
+#else
+ (void) save_ClearBufferiv;
+ (void) save_ClearBufferuiv;
+ (void) save_ClearBufferfv;
+ (void) save_ClearBufferfi;
+#endif
}
GLboolean done;
if (!islist(ctx, list)) {
- _mesa_printf("%u is not a display list ID\n", list);
+ printf("%u is not a display list ID\n", list);
return;
}
n = dlist->Head;
- _mesa_printf("START-LIST %u, address %p\n", list, (void *) n);
+ printf("START-LIST %u, address %p\n", list, (void *) n);
done = n ? GL_FALSE : GL_TRUE;
while (!done) {
- OpCode opcode = n[0].opcode;
- GLint i = (GLint) n[0].opcode - (GLint) OPCODE_EXT_0;
+ const OpCode opcode = n[0].opcode;
- if (i >= 0 && i < (GLint) ctx->ListExt.NumOpcodes) {
- /* this is a driver-extended opcode */
- ctx->ListExt.Opcode[i].Print(ctx, &n[1]);
- n += ctx->ListExt.Opcode[i].Size;
+ if (is_ext_opcode(opcode)) {
+ n += ext_opcode_print(ctx, n);
}
else {
switch (opcode) {
case OPCODE_ACCUM:
- _mesa_printf("Accum %s %g\n", enum_string(n[1].e), n[2].f);
+ printf("Accum %s %g\n", enum_string(n[1].e), n[2].f);
break;
case OPCODE_BITMAP:
- _mesa_printf("Bitmap %d %d %g %g %g %g %p\n", n[1].i, n[2].i,
+ printf("Bitmap %d %d %g %g %g %g %p\n", n[1].i, n[2].i,
n[3].f, n[4].f, n[5].f, n[6].f, (void *) n[7].data);
break;
case OPCODE_CALL_LIST:
- _mesa_printf("CallList %d\n", (int) n[1].ui);
+ printf("CallList %d\n", (int) n[1].ui);
break;
case OPCODE_CALL_LIST_OFFSET:
- _mesa_printf("CallList %d + offset %u = %u\n", (int) n[1].ui,
+ printf("CallList %d + offset %u = %u\n", (int) n[1].ui,
ctx->List.ListBase, ctx->List.ListBase + n[1].ui);
break;
case OPCODE_COLOR_TABLE_PARAMETER_FV:
- _mesa_printf("ColorTableParameterfv %s %s %f %f %f %f\n",
+ printf("ColorTableParameterfv %s %s %f %f %f %f\n",
enum_string(n[1].e), enum_string(n[2].e),
n[3].f, n[4].f, n[5].f, n[6].f);
break;
case OPCODE_COLOR_TABLE_PARAMETER_IV:
- _mesa_printf("ColorTableParameteriv %s %s %d %d %d %d\n",
+ printf("ColorTableParameteriv %s %s %d %d %d %d\n",
enum_string(n[1].e), enum_string(n[2].e),
n[3].i, n[4].i, n[5].i, n[6].i);
break;
case OPCODE_DISABLE:
- _mesa_printf("Disable %s\n", enum_string(n[1].e));
+ printf("Disable %s\n", enum_string(n[1].e));
break;
case OPCODE_ENABLE:
- _mesa_printf("Enable %s\n", enum_string(n[1].e));
+ printf("Enable %s\n", enum_string(n[1].e));
break;
case OPCODE_FRUSTUM:
- _mesa_printf("Frustum %g %g %g %g %g %g\n",
+ printf("Frustum %g %g %g %g %g %g\n",
n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f);
break;
case OPCODE_LINE_STIPPLE:
- _mesa_printf("LineStipple %d %x\n", n[1].i, (int) n[2].us);
+ printf("LineStipple %d %x\n", n[1].i, (int) n[2].us);
break;
case OPCODE_LOAD_IDENTITY:
- _mesa_printf("LoadIdentity\n");
+ printf("LoadIdentity\n");
break;
case OPCODE_LOAD_MATRIX:
- _mesa_printf("LoadMatrix\n");
- _mesa_printf(" %8f %8f %8f %8f\n",
+ printf("LoadMatrix\n");
+ printf(" %8f %8f %8f %8f\n",
n[1].f, n[5].f, n[9].f, n[13].f);
- _mesa_printf(" %8f %8f %8f %8f\n",
+ printf(" %8f %8f %8f %8f\n",
n[2].f, n[6].f, n[10].f, n[14].f);
- _mesa_printf(" %8f %8f %8f %8f\n",
+ printf(" %8f %8f %8f %8f\n",
n[3].f, n[7].f, n[11].f, n[15].f);
- _mesa_printf(" %8f %8f %8f %8f\n",
+ printf(" %8f %8f %8f %8f\n",
n[4].f, n[8].f, n[12].f, n[16].f);
break;
case OPCODE_MULT_MATRIX:
- _mesa_printf("MultMatrix (or Rotate)\n");
- _mesa_printf(" %8f %8f %8f %8f\n",
+ printf("MultMatrix (or Rotate)\n");
+ printf(" %8f %8f %8f %8f\n",
n[1].f, n[5].f, n[9].f, n[13].f);
- _mesa_printf(" %8f %8f %8f %8f\n",
+ printf(" %8f %8f %8f %8f\n",
n[2].f, n[6].f, n[10].f, n[14].f);
- _mesa_printf(" %8f %8f %8f %8f\n",
+ printf(" %8f %8f %8f %8f\n",
n[3].f, n[7].f, n[11].f, n[15].f);
- _mesa_printf(" %8f %8f %8f %8f\n",
+ printf(" %8f %8f %8f %8f\n",
n[4].f, n[8].f, n[12].f, n[16].f);
break;
case OPCODE_ORTHO:
- _mesa_printf("Ortho %g %g %g %g %g %g\n",
+ printf("Ortho %g %g %g %g %g %g\n",
n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f);
break;
case OPCODE_POP_ATTRIB:
- _mesa_printf("PopAttrib\n");
+ printf("PopAttrib\n");
break;
case OPCODE_POP_MATRIX:
- _mesa_printf("PopMatrix\n");
+ printf("PopMatrix\n");
break;
case OPCODE_POP_NAME:
- _mesa_printf("PopName\n");
+ printf("PopName\n");
break;
case OPCODE_PUSH_ATTRIB:
- _mesa_printf("PushAttrib %x\n", n[1].bf);
+ printf("PushAttrib %x\n", n[1].bf);
break;
case OPCODE_PUSH_MATRIX:
- _mesa_printf("PushMatrix\n");
+ printf("PushMatrix\n");
break;
case OPCODE_PUSH_NAME:
- _mesa_printf("PushName %d\n", (int) n[1].ui);
+ printf("PushName %d\n", (int) n[1].ui);
break;
case OPCODE_RASTER_POS:
- _mesa_printf("RasterPos %g %g %g %g\n",
+ printf("RasterPos %g %g %g %g\n",
n[1].f, n[2].f, n[3].f, n[4].f);
break;
case OPCODE_ROTATE:
- _mesa_printf("Rotate %g %g %g %g\n",
+ printf("Rotate %g %g %g %g\n",
n[1].f, n[2].f, n[3].f, n[4].f);
break;
case OPCODE_SCALE:
- _mesa_printf("Scale %g %g %g\n", n[1].f, n[2].f, n[3].f);
+ printf("Scale %g %g %g\n", n[1].f, n[2].f, n[3].f);
break;
case OPCODE_TRANSLATE:
- _mesa_printf("Translate %g %g %g\n", n[1].f, n[2].f, n[3].f);
+ printf("Translate %g %g %g\n", n[1].f, n[2].f, n[3].f);
break;
case OPCODE_BIND_TEXTURE:
- _mesa_printf("BindTexture %s %d\n",
+ printf("BindTexture %s %d\n",
_mesa_lookup_enum_by_nr(n[1].ui), n[2].ui);
break;
case OPCODE_SHADE_MODEL:
- _mesa_printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n[1].ui));
+ printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n[1].ui));
break;
case OPCODE_MAP1:
- _mesa_printf("Map1 %s %.3f %.3f %d %d\n",
+ printf("Map1 %s %.3f %.3f %d %d\n",
_mesa_lookup_enum_by_nr(n[1].ui),
n[2].f, n[3].f, n[4].i, n[5].i);
break;
case OPCODE_MAP2:
- _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
+ printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
_mesa_lookup_enum_by_nr(n[1].ui),
n[2].f, n[3].f, n[4].f, n[5].f,
n[6].i, n[7].i, n[8].i, n[9].i);
break;
case OPCODE_MAPGRID1:
- _mesa_printf("MapGrid1 %d %.3f %.3f\n", n[1].i, n[2].f, n[3].f);
+ printf("MapGrid1 %d %.3f %.3f\n", n[1].i, n[2].f, n[3].f);
break;
case OPCODE_MAPGRID2:
- _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
+ printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
n[1].i, n[2].f, n[3].f, n[4].i, n[5].f, n[6].f);
break;
case OPCODE_EVALMESH1:
- _mesa_printf("EvalMesh1 %d %d\n", n[1].i, n[2].i);
+ printf("EvalMesh1 %d %d\n", n[1].i, n[2].i);
break;
case OPCODE_EVALMESH2:
- _mesa_printf("EvalMesh2 %d %d %d %d\n",
+ printf("EvalMesh2 %d %d %d %d\n",
n[1].i, n[2].i, n[3].i, n[4].i);
break;
case OPCODE_ATTR_1F_NV:
- _mesa_printf("ATTR_1F_NV attr %d: %f\n", n[1].i, n[2].f);
+ printf("ATTR_1F_NV attr %d: %f\n", n[1].i, n[2].f);
break;
case OPCODE_ATTR_2F_NV:
- _mesa_printf("ATTR_2F_NV attr %d: %f %f\n",
+ printf("ATTR_2F_NV attr %d: %f %f\n",
n[1].i, n[2].f, n[3].f);
break;
case OPCODE_ATTR_3F_NV:
- _mesa_printf("ATTR_3F_NV attr %d: %f %f %f\n",
+ printf("ATTR_3F_NV attr %d: %f %f %f\n",
n[1].i, n[2].f, n[3].f, n[4].f);
break;
case OPCODE_ATTR_4F_NV:
- _mesa_printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
+ printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
n[1].i, n[2].f, n[3].f, n[4].f, n[5].f);
break;
case OPCODE_ATTR_1F_ARB:
- _mesa_printf("ATTR_1F_ARB attr %d: %f\n", n[1].i, n[2].f);
+ printf("ATTR_1F_ARB attr %d: %f\n", n[1].i, n[2].f);
break;
case OPCODE_ATTR_2F_ARB:
- _mesa_printf("ATTR_2F_ARB attr %d: %f %f\n",
+ printf("ATTR_2F_ARB attr %d: %f %f\n",
n[1].i, n[2].f, n[3].f);
break;
case OPCODE_ATTR_3F_ARB:
- _mesa_printf("ATTR_3F_ARB attr %d: %f %f %f\n",
+ printf("ATTR_3F_ARB attr %d: %f %f %f\n",
n[1].i, n[2].f, n[3].f, n[4].f);
break;
case OPCODE_ATTR_4F_ARB:
- _mesa_printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
+ printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
n[1].i, n[2].f, n[3].f, n[4].f, n[5].f);
break;
case OPCODE_MATERIAL:
- _mesa_printf("MATERIAL %x %x: %f %f %f %f\n",
+ printf("MATERIAL %x %x: %f %f %f %f\n",
n[1].i, n[2].i, n[3].f, n[4].f, n[5].f, n[6].f);
break;
case OPCODE_BEGIN:
- _mesa_printf("BEGIN %x\n", n[1].i);
+ printf("BEGIN %x\n", n[1].i);
break;
case OPCODE_END:
- _mesa_printf("END\n");
+ printf("END\n");
break;
case OPCODE_RECTF:
- _mesa_printf("RECTF %f %f %f %f\n", n[1].f, n[2].f, n[3].f,
+ printf("RECTF %f %f %f %f\n", n[1].f, n[2].f, n[3].f,
n[4].f);
break;
case OPCODE_EVAL_C1:
- _mesa_printf("EVAL_C1 %f\n", n[1].f);
+ printf("EVAL_C1 %f\n", n[1].f);
break;
case OPCODE_EVAL_C2:
- _mesa_printf("EVAL_C2 %f %f\n", n[1].f, n[2].f);
+ printf("EVAL_C2 %f %f\n", n[1].f, n[2].f);
break;
case OPCODE_EVAL_P1:
- _mesa_printf("EVAL_P1 %d\n", n[1].i);
+ printf("EVAL_P1 %d\n", n[1].i);
break;
case OPCODE_EVAL_P2:
- _mesa_printf("EVAL_P2 %d %d\n", n[1].i, n[2].i);
+ printf("EVAL_P2 %d %d\n", n[1].i, n[2].i);
break;
case OPCODE_PROVOKING_VERTEX:
- _mesa_printf("ProvokingVertex %s\n",
+ printf("ProvokingVertex %s\n",
_mesa_lookup_enum_by_nr(n[1].ui));
break;
* meta opcodes/commands
*/
case OPCODE_ERROR:
- _mesa_printf("Error: %s %s\n",
+ printf("Error: %s %s\n",
enum_string(n[1].e), (const char *) n[2].data);
break;
case OPCODE_CONTINUE:
- _mesa_printf("DISPLAY-LIST-CONTINUE\n");
+ printf("DISPLAY-LIST-CONTINUE\n");
n = (Node *) n[1].next;
break;
case OPCODE_END_OF_LIST:
- _mesa_printf("END-LIST %u\n", list);
+ printf("END-LIST %u\n", list);
done = GL_TRUE;
break;
default:
if (opcode < 0 || opcode > OPCODE_END_OF_LIST) {
- _mesa_printf
+ printf
("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
opcode, (void *) n);
return;
}
else {
- _mesa_printf("command %d, %u operands\n", opcode,
+ printf("command %d, %u operands\n", opcode,
InstSize[opcode]);
}
}
/* zero-out the instruction size table, just once */
if (!tableInitialized) {
- _mesa_bzero(InstSize, sizeof(InstSize));
+ memset(InstSize, 0, sizeof(InstSize));
tableInitialized = GL_TRUE;
}
+ /* extension info */
+ ctx->ListExt = CALLOC_STRUCT(gl_list_extensions);
+
/* Display list */
ctx->ListState.CallDepth = 0;
ctx->ExecuteFlag = GL_TRUE;
_mesa_save_vtxfmt_init(&ctx->ListState.ListVtxfmt);
#endif
}
+
+
+void
+_mesa_free_display_list_data(GLcontext *ctx)
+{
+ free(ctx->ListExt);
+ ctx->ListExt = NULL;
+}