"gl_" to match other structs.
* mesa fragment_program struct.
*/
struct i915_fragment_program {
- struct fragment_program FragProg;
+ struct gl_fragment_program FragProg;
GLboolean translated;
GLboolean params_uptodate;
*/
static GLuint src_vector( struct i915_fragment_program *p,
const struct prog_src_register *source,
- const struct fragment_program *program )
+ const struct gl_fragment_program *program )
{
GLuint src;
*/
static void upload_program( struct i915_fragment_program *p )
{
- const struct fragment_program *program = p->ctx->FragmentProgram._Current;
+ const struct gl_fragment_program *program = p->ctx->FragmentProgram._Current;
const struct prog_instruction *inst = program->Base.Instructions;
/* _mesa_debug_fp_inst(program->Base.NumInstructions, inst); */
static void i915BindProgram( GLcontext *ctx,
GLenum target,
- struct program *prog )
+ struct gl_program *prog )
{
if (target == GL_FRAGMENT_PROGRAM_ARB) {
i915ContextPtr i915 = I915_CONTEXT(ctx);
}
}
-static struct program *i915NewProgram( GLcontext *ctx,
+static struct gl_program *i915NewProgram( GLcontext *ctx,
GLenum target,
GLuint id )
{
switch (target) {
case GL_VERTEX_PROGRAM_ARB:
- return _mesa_init_vertex_program( ctx, CALLOC_STRUCT(vertex_program),
+ return _mesa_init_vertex_program( ctx, CALLOC_STRUCT(gl_vertex_program),
target, id );
case GL_FRAGMENT_PROGRAM_ARB: {
}
static void i915DeleteProgram( GLcontext *ctx,
- struct program *prog )
+ struct gl_program *prog )
{
if (prog->Target == GL_FRAGMENT_PROGRAM_ARB) {
i915ContextPtr i915 = I915_CONTEXT(ctx);
static GLboolean i915IsProgramNative( GLcontext *ctx,
GLenum target,
- struct program *prog )
+ struct gl_program *prog )
{
if (target == GL_FRAGMENT_PROGRAM_ARB) {
struct i915_fragment_program *p = (struct i915_fragment_program *)prog;
static void i915ProgramStringNotify( GLcontext *ctx,
GLenum target,
- struct program *prog )
+ struct gl_program *prog )
{
if (target == GL_FRAGMENT_PROGRAM_ARB) {
struct i915_fragment_program *p = (struct i915_fragment_program *)prog;
TNLcontext *tnl = TNL_CONTEXT(ctx);
intelContextPtr intel = INTEL_CONTEXT(ctx);
GLuint flags = ctx->_TriangleCaps;
- const struct fragment_program *fprog = ctx->FragmentProgram._Current;
+ const struct gl_fragment_program *fprog = ctx->FragmentProgram._Current;
GLboolean have_wpos = (fprog && (fprog->Base.InputsRead & FRAG_BIT_WPOS));
GLuint index = 0;
struct r200_vertex_program {
- struct vertex_program mesa_program; /* Must be first */
+ struct gl_vertex_program mesa_program; /* Must be first */
int translated;
VERTEX_SHADER_INSTRUCTION instr[R200_VSF_MAX_INST + 2];
int pos_end;
r200ContextPtr rmesa = R200_CONTEXT( ctx );
GLfloat *fcmd = (GLfloat *)&rmesa->hw.vpp[0].cmd[VPP_CMD_0 + 1];
int pi;
- struct vertex_program *mesa_vp = (void *)vp;
- struct program_parameter_list *paramList;
+ struct gl_vertex_program *mesa_vp = (void *)vp;
+ struct gl_program_parameter_list *paramList;
drm_radeon_cmd_header_t tmp;
R200_STATECHANGE( rmesa, vpp[0] );
static GLboolean r200_translate_vertex_program(struct r200_vertex_program *vp)
{
- struct vertex_program *mesa_vp = (void *)vp;
+ struct gl_vertex_program *mesa_vp = (void *)vp;
struct prog_instruction *vpi;
int i;
VERTEX_SHADER_INSTRUCTION *o_inst;
}*/
/* FIXME: is changing the prog safe to do here? */
if (mesa_vp->IsPositionInvariant) {
- struct program_parameter_list *paramList;
+ struct gl_program_parameter_list *paramList;
GLint tokens[6] = { STATE_MATRIX, STATE_MVP, 0, 0, 0, STATE_MATRIX };
#ifdef PREFER_DP4
}
-static void r200BindProgram(GLcontext *ctx, GLenum target, struct program *prog)
+static void
+r200BindProgram(GLcontext *ctx, GLenum target, struct gl_program *prog)
{
r200ContextPtr rmesa = R200_CONTEXT(ctx);
}
}
-static struct program *r200NewProgram(GLcontext *ctx, GLenum target, GLuint id)
+static struct gl_program *
+r200NewProgram(GLcontext *ctx, GLenum target, GLuint id)
{
struct r200_vertex_program *vp;
return _mesa_init_vertex_program(ctx, &vp->mesa_program, target, id);
case GL_FRAGMENT_PROGRAM_ARB:
case GL_FRAGMENT_PROGRAM_NV:
- return _mesa_init_fragment_program( ctx, CALLOC_STRUCT(fragment_program), target, id );
+ return _mesa_init_fragment_program( ctx, CALLOC_STRUCT(gl_fragment_program), target, id );
default:
_mesa_problem(ctx, "Bad target in r200NewProgram");
}
}
-static void r200DeleteProgram(GLcontext *ctx, struct program *prog)
+static void
+r200DeleteProgram(GLcontext *ctx, struct gl_program *prog)
{
_mesa_delete_program(ctx, prog);
}
-static void r200ProgramStringNotify(GLcontext *ctx, GLenum target, struct program *prog)
+static void
+r200ProgramStringNotify(GLcontext *ctx, GLenum target, struct gl_program *prog)
{
struct r200_vertex_program *vp = (void *)prog;
switch(target) {
case GL_VERTEX_PROGRAM_ARB:
vp->translated = GL_FALSE;
- memset(&vp->translated, 0, sizeof(struct r200_vertex_program) - sizeof(struct vertex_program));
+ memset(&vp->translated, 0, sizeof(struct r200_vertex_program) - sizeof(struct gl_vertex_program));
/*r200_translate_vertex_shader(vp);*/
break;
}
_tnl_program_string(ctx, target, prog);
}
-static GLboolean r200IsProgramNative(GLcontext *ctx, GLenum target, struct program *prog)
+static GLboolean
+r200IsProgramNative(GLcontext *ctx, GLenum target, struct gl_program *prog)
{
struct r200_vertex_program *vp = (void *)prog;
* Keeping them them seperate for now should ensure fixed pipeline keeps functioning properly.
*/
struct r300_vertex_program {
- struct vertex_program mesa_program; /* Must be first */
+ struct gl_vertex_program mesa_program; /* Must be first */
int translated;
struct r300_vertex_shader_fragment program;
};
struct r300_fragment_program {
- struct fragment_program mesa_program;
+ struct gl_fragment_program mesa_program;
GLcontext *ctx;
GLboolean translated;
struct r300_hw_state hw;
struct r300_cmdbuf cmdbuf;
struct r300_state state;
- struct vertex_program *curr_vp;
+ struct gl_vertex_program *curr_vp;
/* Vertex buffers
*/
}
/* no point swizzling ONE/ZERO/HALF constants... */
- if (r.v_swz < SWIZZLE_111 || r.s_swz < SWIZZLE_ZERO)
+ if (r.v_swz < SWIZZLE_111 && r.s_swz < SWIZZLE_ZERO)
r = do_swizzle(rp, r, fpsrc.Swizzle, fpsrc.NegateBase);
#if 0
/* WRONG! Need to be able to do individual component negation,
#if 0
static pfs_reg_t get_attrib(struct r300_fragment_program *rp, GLuint attr)
{
- struct fragment_program *mp = &rp->mesa_program;
+ struct gl_fragment_program *mp = &rp->mesa_program;
pfs_reg_t r = undef;
if (!(mp->Base.InputsRead & (1<<attr))) {
static GLboolean parse_program(struct r300_fragment_program *rp)
{
- struct fragment_program *mp = &rp->mesa_program;
+ struct gl_fragment_program *mp = &rp->mesa_program;
const struct prog_instruction *inst = mp->Base.Instructions;
struct prog_instruction *fpi;
pfs_reg_t src[3], dest, temp;
static void init_program(struct r300_fragment_program *rp)
{
struct r300_pfs_compile_state *cs = NULL;
- struct fragment_program *mp = &rp->mesa_program;
+ struct gl_fragment_program *mp = &rp->mesa_program;
struct prog_instruction *fpi;
GLuint InputsRead = mp->Base.InputsRead;
GLuint temps_used = 0; /* for rp->temps[] */
static void update_params(struct r300_fragment_program *rp)
{
- struct fragment_program *mp = &rp->mesa_program;
+ struct gl_fragment_program *mp = &rp->mesa_program;
int i;
/* Ask Mesa nicely to fill in ParameterValues for us */
((arg1) << R300_FPI2_ARG1A_SHIFT) | \
((arg2) << R300_FPI2_ARG2A_SHIFT))
-extern void debug_vp(GLcontext *ctx, struct vertex_program *vp);
+extern void debug_vp(GLcontext *ctx, struct gl_vertex_program *vp);
#endif /* __R300_PROGRAM_H__ */
#include "r300_context.h"
#include "r300_fragprog.h"
-static void r300BindProgram(GLcontext *ctx, GLenum target, struct program *prog)
+static void
+r300BindProgram(GLcontext *ctx, GLenum target, struct gl_program *prog)
{
r300ContextPtr rmesa = R300_CONTEXT(ctx);
switch(target){
case GL_VERTEX_PROGRAM_ARB:
- rmesa->curr_vp = (struct vertex_program *)vp;
+ rmesa->curr_vp = (struct gl_vertex_program *)vp;
vp->ref_count++;
#if 0
if((vp->ref_count % 1500) == 0) {
}
}
-static struct program *r300NewProgram(GLcontext *ctx, GLenum target, GLuint id)
+static struct gl_program *
+r300NewProgram(GLcontext *ctx, GLenum target, GLuint id)
{
struct r300_vertex_program *vp;
struct r300_fragment_program *fp;
}
-static void r300DeleteProgram(GLcontext *ctx, struct program *prog)
+static void
+r300DeleteProgram(GLcontext *ctx, struct gl_program *prog)
{
#if 0
r300ContextPtr rmesa = R300_CONTEXT(ctx);
_mesa_delete_program(ctx, prog);
}
-static void r300ProgramStringNotify(GLcontext *ctx, GLenum target,
- struct program *prog)
+static void
+r300ProgramStringNotify(GLcontext *ctx, GLenum target, struct gl_program *prog)
{
struct r300_vertex_program *vp=(void *)prog;
struct r300_fragment_program *fp = (struct r300_fragment_program *) prog;
switch(target) {
case GL_VERTEX_PROGRAM_ARB:
vp->translated = GL_FALSE;
- memset(&vp->translated, 0, sizeof(struct r300_vertex_program) - sizeof(struct vertex_program));
+ memset(&vp->translated, 0, sizeof(struct r300_vertex_program) - sizeof(struct gl_vertex_program));
/*r300_translate_vertex_shader(vp);*/
break;
case GL_FRAGMENT_PROGRAM_ARB:
_tnl_program_string(ctx, target, prog);
}
-static GLboolean r300IsProgramNative(GLcontext *ctx, GLenum target, struct program *prog)
+static GLboolean
+r300IsProgramNative(GLcontext *ctx, GLenum target, struct gl_program *prog)
{
//struct r300_vertex_program *vp=(void *)prog;
//r300ContextPtr rmesa = R300_CONTEXT(ctx);
int r300VertexProgUpdateParams(GLcontext *ctx, struct r300_vertex_program *vp, float *dst)
{
int pi;
- struct vertex_program *mesa_vp=(void *)vp;
+ struct gl_vertex_program *mesa_vp=(void *)vp;
float *dst_o=dst;
- struct program_parameter_list *paramList;
+ struct gl_program_parameter_list *paramList;
if (mesa_vp->IsNVProgram) {
_mesa_init_vp_per_primitive_registers(ctx);
void r300_translate_vertex_shader(struct r300_vertex_program *vp)
{
- struct vertex_program *mesa_vp=(void *)vp;
+ struct gl_vertex_program *mesa_vp=(void *)vp;
struct prog_instruction *vpi;
int i, cur_reg=0;
VERTEX_SHADER_INSTRUCTION *o_inst;
}
if (mesa_vp->IsPositionInvariant) {
- struct program_parameter_list *paramList;
+ struct gl_program_parameter_list *paramList;
GLint tokens[6] = { STATE_MATRIX, STATE_MVP, 0, 0, 0, STATE_MATRIX };
#ifdef PREFER_DP4
static void
delete_program_cb(GLuint id, void *data, void *userData)
{
- struct program *prog = (struct program *) data;
+ struct gl_program *prog = (struct gl_program *) data;
GLcontext *ctx = (GLcontext *) userData;
ctx->Driver.DeleteProgram(ctx, prog);
}
*/
/*@{*/
/** Bind a vertex/fragment program */
- void (*BindProgram)(GLcontext *ctx, GLenum target, struct program *prog);
+ void (*BindProgram)(GLcontext *ctx, GLenum target, struct gl_program *prog);
/** Allocate a new program */
- struct program * (*NewProgram)(GLcontext *ctx, GLenum target, GLuint id);
+ struct gl_program * (*NewProgram)(GLcontext *ctx, GLenum target, GLuint id);
/** Delete a program */
- void (*DeleteProgram)(GLcontext *ctx, struct program *prog);
+ void (*DeleteProgram)(GLcontext *ctx, struct gl_program *prog);
/** Notify driver that a program string has been specified. */
void (*ProgramStringNotify)(GLcontext *ctx, GLenum target,
- struct program *prog);
+ struct gl_program *prog);
/** Query if program can be loaded onto hardware */
GLboolean (*IsProgramNative)(GLcontext *ctx, GLenum target,
- struct program *prog);
+ struct gl_program *prog);
/*@}*/
struct texenvprog_cache_item {
GLuint hash;
void *key;
- struct fragment_program *data;
+ struct gl_fragment_program *data;
struct texenvprog_cache_item *next;
};
/** Vertex and fragment instructions */
struct prog_instruction;
-struct program_parameter_list;
+struct gl_program_parameter_list;
/**
* Base class for any kind of program object
*/
-struct program
+struct gl_program
{
GLuint Id;
GLubyte *String; /**< Null-terminated program text */
GLbitfield OutputsWritten; /* Bitmask of which output regs are written to */
/** Named parameters, constants, etc. from program text */
- struct program_parameter_list *Parameters;
+ struct gl_program_parameter_list *Parameters;
/** Numbered local parameters */
GLfloat LocalParams[MAX_PROGRAM_LOCAL_PARAMS][4];
/** Vertex program object */
-struct vertex_program
+struct gl_vertex_program
{
- struct program Base; /* base class */
- GLboolean IsNVProgram; /* GL_NV_vertex_program ? */
- GLboolean IsPositionInvariant; /* GL_ARB_vertex_program / GL_NV_vertex_program1_1 */
- void *TnlData; /* should probably use Base.DriverData */
+ struct gl_program Base; /**< base class */
+ GLboolean IsNVProgram; /**< is this a GL_NV_vertex_program program? */
+ GLboolean IsPositionInvariant;
+ void *TnlData; /**< should probably use Base.DriverData */
};
/** Fragment program object */
-struct fragment_program
+struct gl_fragment_program
{
- struct program Base; /**< base class */
+ struct gl_program Base; /**< base class */
GLbitfield TexturesUsed[MAX_TEXTURE_IMAGE_UNITS]; /**< TEXTURE_x_BIT bitmask */
GLuint NumAluInstructions; /**< GL_ARB_fragment_program */
GLuint NumTexInstructions;
GLboolean _Enabled; /**< Enabled and valid program? */
GLboolean PointSizeEnabled; /**< GL_VERTEX_PROGRAM_POINT_SIZE_ARB/NV */
GLboolean TwoSideEnabled; /**< GL_VERTEX_PROGRAM_TWO_SIDE_ARB/NV */
- struct vertex_program *Current; /**< ptr to currently bound program */
- const struct vertex_program *_Current; /**< ptr to currently bound
+ struct gl_vertex_program *Current; /**< ptr to currently bound program */
+ const struct gl_vertex_program *_Current; /**< ptr to currently bound
program, including internal
(t_vp_build.c) programs */
GLboolean Enabled; /* GL_VERTEX_PROGRAM_NV */
GLboolean _Enabled; /* Enabled and valid program? */
GLboolean _Active;
- struct fragment_program *Current; /* ptr to currently bound program */
- const struct fragment_program *_Current; /* ptr to currently active program
+ struct gl_fragment_program *Current; /* ptr to currently bound program */
+ const struct gl_fragment_program *_Current; /* ptr to currently active program
(including internal programs) */
struct fp_machine Machine; /* machine state */
GLfloat Parameters[MAX_NV_FRAGMENT_PROGRAM_PARAMS][4]; /* Env params */
/*@{*/
struct _mesa_HashTable *Programs; /**< All vertex/fragment programs */
#if FEATURE_ARB_vertex_program
- struct program *DefaultVertexProgram;
+ struct gl_program *DefaultVertexProgram;
#endif
#if FEATURE_ARB_fragment_program
- struct program *DefaultFragmentProgram;
+ struct gl_program *DefaultFragmentProgram;
#endif
/*@}*/
struct gl_fragment_program_state FragmentProgram; /**< GL_ARB/NV_vertex_program */
struct gl_ati_fragment_shader_state ATIFragmentShader; /**< GL_ATI_fragment_shader */
- struct fragment_program *_TexEnvProgram; /**< Texture state as fragment program */
- struct vertex_program *_TnlProgram; /**< Fixed func TNL state as vertex program */
+ struct gl_fragment_program *_TexEnvProgram; /**< Texture state as fragment program */
+ struct gl_vertex_program *_TnlProgram; /**< Fixed func TNL state as vertex program */
GLboolean _MaintainTnlProgram;
GLboolean _MaintainTexEnvProgram;
if (ctx->_MaintainTexEnvProgram && !ctx->FragmentProgram._Enabled) {
#if 0
if (!ctx->_TexEnvProgram)
- ctx->_TexEnvProgram = (struct fragment_program *)
+ ctx->_TexEnvProgram = (struct gl_fragment_program *)
ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0);
ctx->FragmentProgram._Current = ctx->_TexEnvProgram;
#endif
/* State used to build the fragment program:
*/
struct texenv_fragment_program {
- struct fragment_program *program;
+ struct gl_fragment_program *program;
GLcontext *ctx;
struct state_key *state;
*/
static void
create_new_program(struct state_key *key, GLcontext *ctx,
- struct fragment_program *program)
+ struct gl_fragment_program *program)
{
struct texenv_fragment_program p;
GLuint unit;
}
-static struct fragment_program *
+static struct gl_fragment_program *
search_cache(const struct texenvprog_cache *cache,
GLuint hash,
const void *key,
for (c = cache->items[hash % cache->size]; c; c = c->next) {
if (c->hash == hash && memcmp(c->key, key, keysize) == 0)
- return (struct fragment_program *) c->data;
+ return (struct gl_fragment_program *) c->data;
}
return NULL;
for (c = cache->items[i]; c; c = next) {
next = c->next;
_mesa_free(c->key);
- cache->ctx->Driver.DeleteProgram(cache->ctx, (struct program *)c->data);
+ cache->ctx->Driver.DeleteProgram(cache->ctx,
+ (struct gl_program *) c->data);
_mesa_free(c);
}
cache->items[i] = NULL;
{
struct state_key key;
GLuint hash;
- const struct fragment_program *prev = ctx->FragmentProgram._Current;
+ const struct gl_fragment_program *prev = ctx->FragmentProgram._Current;
if (!ctx->FragmentProgram._Enabled) {
make_state_key(ctx, &key);
if (0) _mesa_printf("Building new texenv proggy for key %x\n", hash);
ctx->FragmentProgram._Current = ctx->_TexEnvProgram =
- (struct fragment_program *)
+ (struct gl_fragment_program *)
ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0);
create_new_program(&key, ctx, ctx->_TexEnvProgram);
*/
if (ctx->FragmentProgram._Current != prev && ctx->Driver.BindProgram) {
ctx->Driver.BindProgram(ctx, GL_FRAGMENT_PROGRAM_ARB,
- (struct program *) ctx->FragmentProgram._Current);
+ (struct gl_program *) ctx->FragmentProgram._Current);
}
}
*/
struct arb_program
{
- struct program Base;
+ struct gl_program Base;
GLuint Position; /* Just used for error reporting while parsing */
GLuint MajorVersion;
void
_mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target,
const GLvoid *str, GLsizei len,
- struct fragment_program *program)
+ struct gl_fragment_program *program)
{
struct arb_program ap;
GLuint i;
void
_mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target,
const GLvoid *str, GLsizei len,
- struct vertex_program *program)
+ struct gl_vertex_program *program)
{
struct arb_program ap;
extern void
_mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target,
const GLvoid *str, GLsizei len,
- struct vertex_program *program);
+ struct gl_vertex_program *program);
extern void
_mesa_parse_arb_fragment_program(GLcontext *ctx, GLenum target,
const GLvoid *str, GLsizei len,
- struct fragment_program *program);
+ struct gl_fragment_program *program);
#endif
if (target == GL_VERTEX_PROGRAM_ARB
&& ctx->Extensions.ARB_vertex_program) {
- struct vertex_program *prog = ctx->VertexProgram.Current;
+ struct gl_vertex_program *prog = ctx->VertexProgram.Current;
_mesa_parse_arb_vertex_program(ctx, target, string, len, prog);
if (ctx->Driver.ProgramStringNotify)
}
else if (target == GL_FRAGMENT_PROGRAM_ARB
&& ctx->Extensions.ARB_fragment_program) {
- struct fragment_program *prog = ctx->FragmentProgram.Current;
+ struct gl_fragment_program *prog = ctx->FragmentProgram.Current;
_mesa_parse_arb_fragment_program(ctx, target, string, len, prog);
if (ctx->Driver.ProgramStringNotify)
GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
GET_CURRENT_CONTEXT(ctx);
- struct program *prog;
+ struct gl_program *prog;
ASSERT_OUTSIDE_BEGIN_END(ctx);
FLUSH_VERTICES(ctx, _NEW_PROGRAM);
_mesa_GetProgramLocalParameterfvARB(GLenum target, GLuint index,
GLfloat *params)
{
- const struct program *prog;
+ const struct gl_program *prog;
GLuint maxParams;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
_mesa_GetProgramivARB(GLenum target, GLenum pname, GLint *params)
{
const struct gl_program_constants *limits;
- struct program *prog;
+ struct gl_program *prog;
GET_CURRENT_CONTEXT(ctx);
if (!ctx->_CurrentProgram)
* The following apply to fragment programs only (at this time)
*/
if (target == GL_FRAGMENT_PROGRAM_ARB) {
- const struct fragment_program *fp = ctx->FragmentProgram.Current;
+ const struct gl_fragment_program *fp = ctx->FragmentProgram.Current;
switch (pname) {
case GL_PROGRAM_ALU_INSTRUCTIONS_ARB:
*params = fp->NumNativeAluInstructions;
void GLAPIENTRY
_mesa_GetProgramStringARB(GLenum target, GLenum pname, GLvoid *string)
{
- const struct program *prog;
+ const struct gl_program *prog;
GET_CURRENT_CONTEXT(ctx);
if (!ctx->_CurrentProgram)
const GLubyte *start; /* start of program string */
const GLubyte *pos; /* current position */
const GLubyte *curLine;
- struct fragment_program *program; /* current program */
+ struct gl_fragment_program *program; /* current program */
- struct program_parameter_list *parameters;
+ struct gl_program_parameter_list *parameters;
GLuint numInst; /* number of instructions parsed */
GLuint inputsRead; /* bitmask of input registers used */
void
_mesa_parse_nv_fragment_program(GLcontext *ctx, GLenum dstTarget,
const GLubyte *str, GLsizei len,
- struct fragment_program *program)
+ struct gl_fragment_program *program)
{
struct parse_state parseState;
struct prog_instruction instBuffer[MAX_NV_FRAGMENT_PROGRAM_INSTRUCTIONS];
static void
-PrintSrcReg(const struct fragment_program *program,
+PrintSrcReg(const struct gl_fragment_program *program,
const struct prog_src_register *src)
{
static const char comps[5] = "xyzw";
* Print (unparse) the given vertex program. Just for debugging.
*/
void
-_mesa_print_nv_fragment_program(const struct fragment_program *program)
+_mesa_print_nv_fragment_program(const struct gl_fragment_program *program)
{
const struct prog_instruction *inst;
extern void
_mesa_parse_nv_fragment_program(GLcontext *ctx, GLenum target,
const GLubyte *str, GLsizei len,
- struct fragment_program *program);
+ struct gl_fragment_program *program);
extern void
-_mesa_print_nv_fragment_program(const struct fragment_program *program);
+_mesa_print_nv_fragment_program(const struct gl_fragment_program *program);
extern const char *
void GLAPIENTRY
_mesa_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params)
{
- struct vertex_program *vprog;
+ struct gl_vertex_program *vprog;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- vprog = (struct vertex_program *)
+ vprog = (struct gl_vertex_program *)
_mesa_HashLookup(ctx->Shared->Programs, id);
if (!vprog || vprog->Base.Target != GL_VERTEX_STATE_PROGRAM_NV) {
}
for (i = 0; i < n; i++) {
- const struct program *prog;
+ const struct gl_program *prog;
if (ids[i] == 0) {
_mesa_error(ctx, GL_INVALID_VALUE, "glAreProgramsResidentNV");
return GL_FALSE;
}
- prog = (const struct program *)
+ prog = (const struct gl_program *)
_mesa_HashLookup(ctx->Shared->Programs, ids[i]);
if (!prog) {
_mesa_error(ctx, GL_INVALID_VALUE, "glAreProgramsResidentNV");
/* just error checking for now */
for (i = 0; i < n; i++) {
- struct program *prog;
+ struct gl_program *prog;
if (ids[i] == 0) {
_mesa_error(ctx, GL_INVALID_VALUE, "glRequestResidentProgramsNV(id)");
return;
}
- prog = (struct program *) _mesa_HashLookup(ctx->Shared->Programs, ids[i]);
+ prog = (struct gl_program *) _mesa_HashLookup(ctx->Shared->Programs, ids[i]);
if (!prog) {
_mesa_error(ctx, GL_INVALID_VALUE, "glRequestResidentProgramsNV(id)");
return;
void GLAPIENTRY
_mesa_GetProgramivNV(GLuint id, GLenum pname, GLint *params)
{
- struct program *prog;
+ struct gl_program *prog;
GET_CURRENT_CONTEXT(ctx);
if (!ctx->_CurrentProgram)
ASSERT_OUTSIDE_BEGIN_END(ctx);
- prog = (struct program *) _mesa_HashLookup(ctx->Shared->Programs, id);
+ prog = (struct gl_program *) _mesa_HashLookup(ctx->Shared->Programs, id);
if (!prog) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glGetProgramivNV");
return;
void GLAPIENTRY
_mesa_GetProgramStringNV(GLuint id, GLenum pname, GLubyte *program)
{
- struct program *prog;
+ struct gl_program *prog;
GET_CURRENT_CONTEXT(ctx);
if (!ctx->_CurrentProgram)
return;
}
- prog = (struct program *) _mesa_HashLookup(ctx->Shared->Programs, id);
+ prog = (struct gl_program *) _mesa_HashLookup(ctx->Shared->Programs, id);
if (!prog) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glGetProgramStringNV");
return;
_mesa_LoadProgramNV(GLenum target, GLuint id, GLsizei len,
const GLubyte *program)
{
- struct program *prog;
+ struct gl_program *prog;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- prog = (struct program *) _mesa_HashLookup(ctx->Shared->Programs, id);
+ prog = (struct gl_program *) _mesa_HashLookup(ctx->Shared->Programs, id);
if (prog && prog->Target != 0 && prog->Target != target) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glLoadProgramNV(target)");
if ((target == GL_VERTEX_PROGRAM_NV ||
target == GL_VERTEX_STATE_PROGRAM_NV)
&& ctx->Extensions.NV_vertex_program) {
- struct vertex_program *vprog = (struct vertex_program *) prog;
+ struct gl_vertex_program *vprog = (struct gl_vertex_program *) prog;
if (!vprog || prog == &_mesa_DummyProgram) {
- vprog = (struct vertex_program *)
+ vprog = (struct gl_vertex_program *)
ctx->Driver.NewProgram(ctx, target, id);
if (!vprog) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV");
}
else if (target == GL_FRAGMENT_PROGRAM_NV
&& ctx->Extensions.NV_fragment_program) {
- struct fragment_program *fprog = (struct fragment_program *) prog;
+ struct gl_fragment_program *fprog = (struct gl_fragment_program *) prog;
if (!fprog || prog == &_mesa_DummyProgram) {
- fprog = (struct fragment_program *)
+ fprog = (struct gl_fragment_program *)
ctx->Driver.NewProgram(ctx, target, id);
if (!fprog) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV");
_mesa_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte *name,
GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
- struct program *prog;
- struct fragment_program *fragProg;
+ struct gl_program *prog;
+ struct gl_fragment_program *fragProg;
GLfloat *v;
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, _NEW_PROGRAM);
- prog = (struct program *) _mesa_HashLookup(ctx->Shared->Programs, id);
+ prog = (struct gl_program *) _mesa_HashLookup(ctx->Shared->Programs, id);
if (!prog || prog->Target != GL_FRAGMENT_PROGRAM_NV) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glProgramNamedParameterNV");
return;
return;
}
- fragProg = (struct fragment_program *) prog;
+ fragProg = (struct gl_fragment_program *) prog;
v = _mesa_lookup_parameter_value(fragProg->Base.Parameters, len,
(char *) name);
if (v) {
_mesa_GetProgramNamedParameterfvNV(GLuint id, GLsizei len, const GLubyte *name,
GLfloat *params)
{
- struct program *prog;
- struct fragment_program *fragProg;
+ struct gl_program *prog;
+ struct gl_fragment_program *fragProg;
const GLfloat *v;
GET_CURRENT_CONTEXT(ctx);
if (!ctx->_CurrentProgram)
ASSERT_OUTSIDE_BEGIN_END(ctx);
- prog = (struct program *) _mesa_HashLookup(ctx->Shared->Programs, id);
+ prog = (struct gl_program *) _mesa_HashLookup(ctx->Shared->Programs, id);
if (!prog || prog->Target != GL_FRAGMENT_PROGRAM_NV) {
_mesa_error(ctx, GL_INVALID_OPERATION, "glGetProgramNamedParameterNV");
return;
return;
}
- fragProg = (struct fragment_program *) prog;
+ fragProg = (struct gl_fragment_program *) prog;
v = _mesa_lookup_parameter_value(fragProg->Base.Parameters,
len, (char *) name);
if (v) {
* Execute the given vertex program
*/
void
-_mesa_exec_vertex_program(GLcontext *ctx, const struct vertex_program *program)
+_mesa_exec_vertex_program(GLcontext *ctx, const struct gl_vertex_program *program)
{
struct gl_vertex_program_state *state = &ctx->VertexProgram;
const struct prog_instruction *inst;
_mesa_init_vp_per_primitive_registers(GLcontext *ctx);
extern void
-_mesa_exec_vertex_program(GLcontext *ctx, const struct vertex_program *program);
+_mesa_exec_vertex_program(GLcontext *ctx, const struct gl_vertex_program *program);
extern void
_mesa_dump_vp_state( const struct gl_vertex_program_state *state );
void
_mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget,
const GLubyte *str, GLsizei len,
- struct vertex_program *program)
+ struct gl_vertex_program *program)
{
struct parse_state parseState;
struct prog_instruction instBuffer[MAX_NV_VERTEX_PROGRAM_INSTRUCTIONS];
* Print (unparse) the given vertex program. Just for debugging.
*/
void
-_mesa_print_nv_vertex_program(const struct vertex_program *program)
+_mesa_print_nv_vertex_program(const struct gl_vertex_program *program)
{
const struct prog_instruction *inst;
extern void
_mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum target,
const GLubyte *str, GLsizei len,
- struct vertex_program *program);
+ struct gl_vertex_program *program);
extern void
_mesa_print_nv_vertex_instruction(const struct prog_instruction *inst);
extern void
-_mesa_print_nv_vertex_program(const struct vertex_program *program);
+_mesa_print_nv_vertex_program(const struct gl_vertex_program *program);
extern const char *
_mesa_nv_vertex_input_register_name(GLuint i);
/* A pointer to this dummy program is put into the hash table when
* glGenPrograms is called.
*/
-struct program _mesa_DummyProgram;
+struct gl_program _mesa_DummyProgram;
/**
ctx->VertexProgram.Enabled = GL_FALSE;
ctx->VertexProgram.PointSizeEnabled = GL_FALSE;
ctx->VertexProgram.TwoSideEnabled = GL_FALSE;
- ctx->VertexProgram.Current = (struct vertex_program *) ctx->Shared->DefaultVertexProgram;
+ ctx->VertexProgram.Current = (struct gl_vertex_program *) ctx->Shared->DefaultVertexProgram;
assert(ctx->VertexProgram.Current);
ctx->VertexProgram.Current->Base.RefCount++;
for (i = 0; i < MAX_NV_VERTEX_PROGRAM_PARAMS / 4; i++) {
#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program
ctx->FragmentProgram.Enabled = GL_FALSE;
- ctx->FragmentProgram.Current = (struct fragment_program *) ctx->Shared->DefaultFragmentProgram;
+ ctx->FragmentProgram.Current = (struct gl_fragment_program *) ctx->Shared->DefaultFragmentProgram;
assert(ctx->FragmentProgram.Current);
ctx->FragmentProgram.Current->Base.RefCount++;
#endif
/**
* Initialize a new vertex/fragment program object.
*/
-static struct program *
-_mesa_init_program_struct( GLcontext *ctx, struct program *prog,
+static struct gl_program *
+_mesa_init_program_struct( GLcontext *ctx, struct gl_program *prog,
GLenum target, GLuint id)
{
(void) ctx;
/**
* Initialize a new fragment program object.
*/
-struct program *
-_mesa_init_fragment_program( GLcontext *ctx, struct fragment_program *prog,
+struct gl_program *
+_mesa_init_fragment_program( GLcontext *ctx, struct gl_fragment_program *prog,
GLenum target, GLuint id)
{
if (prog)
/**
* Initialize a new vertex program object.
*/
-struct program *
-_mesa_init_vertex_program( GLcontext *ctx, struct vertex_program *prog,
+struct gl_program *
+_mesa_init_vertex_program( GLcontext *ctx, struct gl_vertex_program *prog,
GLenum target, GLuint id)
{
if (prog)
* \param target program target/type
* \return pointer to new program object
*/
-struct program *
+struct gl_program *
_mesa_new_program(GLcontext *ctx, GLenum target, GLuint id)
{
switch (target) {
case GL_VERTEX_PROGRAM_ARB: /* == GL_VERTEX_PROGRAM_NV */
- return _mesa_init_vertex_program( ctx, CALLOC_STRUCT(vertex_program),
- target, id );
+ return _mesa_init_vertex_program(ctx, CALLOC_STRUCT(gl_vertex_program),
+ target, id );
case GL_FRAGMENT_PROGRAM_NV:
case GL_FRAGMENT_PROGRAM_ARB:
- return _mesa_init_fragment_program( ctx, CALLOC_STRUCT(fragment_program),
- target, id );
+ return _mesa_init_fragment_program(ctx,
+ CALLOC_STRUCT(gl_fragment_program),
+ target, id );
default:
_mesa_problem(ctx, "bad target in _mesa_new_program");
return NULL;
* by a device driver function.
*/
void
-_mesa_delete_program(GLcontext *ctx, struct program *prog)
+_mesa_delete_program(GLcontext *ctx, struct gl_program *prog)
{
(void) ctx;
ASSERT(prog);
/* Program parameter functions */
/**********************************************************************/
-struct program_parameter_list *
+struct gl_program_parameter_list *
_mesa_new_parameter_list(void)
{
- return (struct program_parameter_list *)
- _mesa_calloc(sizeof(struct program_parameter_list));
+ return (struct gl_program_parameter_list *)
+ _mesa_calloc(sizeof(struct gl_program_parameter_list));
}
* Free a parameter list and all its parameters
*/
void
-_mesa_free_parameter_list(struct program_parameter_list *paramList)
+_mesa_free_parameter_list(struct gl_program_parameter_list *paramList)
{
GLuint i;
for (i = 0; i < paramList->NumParameters; i++) {
* \return index of new parameter in the list, or -1 if error (out of mem)
*/
static GLint
-add_parameter(struct program_parameter_list *paramList,
+add_parameter(struct gl_program_parameter_list *paramList,
const char *name, const GLfloat values[4],
enum register_file type)
{
paramList->Size *= 2;
/* realloc arrays */
- paramList->Parameters = (struct program_parameter *)
+ paramList->Parameters = (struct gl_program_parameter *)
_mesa_realloc(paramList->Parameters,
- n * sizeof(struct program_parameter),
- paramList->Size * sizeof(struct program_parameter));
+ n * sizeof(struct gl_program_parameter),
+ paramList->Size * sizeof(struct gl_program_parameter));
paramList->ParameterValues = (GLfloat (*)[4])
_mesa_align_realloc(paramList->ParameterValues, /* old buf */
paramList->NumParameters = n + 1;
_mesa_memset(¶mList->Parameters[n], 0,
- sizeof(struct program_parameter));
+ sizeof(struct gl_program_parameter));
paramList->Parameters[n].Name = name ? _mesa_strdup(name) : NULL;
paramList->Parameters[n].Type = type;
* \return index of the new entry in the parameter list
*/
GLint
-_mesa_add_named_parameter(struct program_parameter_list *paramList,
+_mesa_add_named_parameter(struct gl_program_parameter_list *paramList,
const char *name, const GLfloat values[4])
{
return add_parameter(paramList, name, values, PROGRAM_NAMED_PARAM);
* \return index of the new parameter.
*/
GLint
-_mesa_add_named_constant(struct program_parameter_list *paramList,
+_mesa_add_named_constant(struct gl_program_parameter_list *paramList,
const char *name, const GLfloat values[4])
{
return add_parameter(paramList, name, values, PROGRAM_CONSTANT);
* \return index of the new parameter.
*/
GLint
-_mesa_add_unnamed_constant(struct program_parameter_list *paramList,
+_mesa_add_unnamed_constant(struct gl_program_parameter_list *paramList,
const GLfloat values[4])
{
return add_parameter(paramList, NULL, values, PROGRAM_CONSTANT);
* \return index of the new parameter.
*/
GLint
-_mesa_add_state_reference(struct program_parameter_list *paramList,
+_mesa_add_state_reference(struct gl_program_parameter_list *paramList,
const GLint *stateTokens)
{
/* XXX we should probably search the current parameter list to see if
* \return pointer to the float[4] values.
*/
GLfloat *
-_mesa_lookup_parameter_value(struct program_parameter_list *paramList,
+_mesa_lookup_parameter_value(struct gl_program_parameter_list *paramList,
GLsizei nameLen, const char *name)
{
GLuint i;
* \return index of parameter in the list.
*/
GLint
-_mesa_lookup_parameter_index(struct program_parameter_list *paramList,
+_mesa_lookup_parameter_index(struct gl_program_parameter_list *paramList,
GLsizei nameLen, const char *name)
{
GLint i;
modifier == STATE_MATRIX_INVTRANS) {
/* Be sure inverse is up to date:
*/
+ _math_matrix_alloc_inv( (GLmatrix *) matrix );
_math_matrix_analyse( (GLmatrix*) matrix );
m = matrix->inv;
}
*/
void
_mesa_load_state_parameters(GLcontext *ctx,
- struct program_parameter_list *paramList)
+ struct gl_program_parameter_list *paramList)
{
GLuint i;
* XXX this function could be greatly improved.
*/
void
-_mesa_print_program(const struct program *prog)
+_mesa_print_program(const struct gl_program *prog)
{
GLuint i;
for (i = 0; i < prog->NumInstructions; i++) {
* Print all of a program's parameters.
*/
void
-_mesa_print_program_parameters(GLcontext *ctx, const struct program *prog)
+_mesa_print_program_parameters(GLcontext *ctx, const struct gl_program *prog)
{
GLint i;
#endif
for (i = 0; i < prog->Parameters->NumParameters; i++){
- struct program_parameter *param = prog->Parameters->Parameters + i;
+ struct gl_program_parameter *param = prog->Parameters->Parameters + i;
const GLfloat *v = prog->Parameters->ParameterValues[i];
_mesa_printf("param[%d] %s = {%.3f, %.3f, %.3f, %.3f};\n",
i, param->Name, v[0], v[1], v[2], v[3]);
void GLAPIENTRY
_mesa_BindProgram(GLenum target, GLuint id)
{
- struct program *prog;
+ struct gl_program *prog;
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
(ctx->Extensions.NV_vertex_program ||
ctx->Extensions.ARB_vertex_program)) {
/*** Vertex program binding ***/
- struct vertex_program *curProg = ctx->VertexProgram.Current;
+ struct gl_vertex_program *curProg = ctx->VertexProgram.Current;
if (curProg->Base.Id == id) {
/* binding same program - no change */
return;
(target == GL_FRAGMENT_PROGRAM_ARB
&& ctx->Extensions.ARB_fragment_program)) {
/*** Fragment program binding ***/
- struct fragment_program *curProg = ctx->FragmentProgram.Current;
+ struct gl_fragment_program *curProg = ctx->FragmentProgram.Current;
if (curProg->Base.Id == id) {
/* binding same program - no change */
return;
}
else {
/* Bind user program */
- prog = (struct program *) _mesa_HashLookup(ctx->Shared->Programs, id);
+ prog = (struct gl_program *) _mesa_HashLookup(ctx->Shared->Programs, id);
if (!prog || prog == &_mesa_DummyProgram) {
/* allocate a new program now */
prog = ctx->Driver.NewProgram(ctx, target, id);
/* bind now */
if (target == GL_VERTEX_PROGRAM_ARB) { /* == GL_VERTEX_PROGRAM_NV */
- ctx->VertexProgram.Current = (struct vertex_program *) prog;
+ ctx->VertexProgram.Current = (struct gl_vertex_program *) prog;
}
else if (target == GL_FRAGMENT_PROGRAM_NV || target == GL_FRAGMENT_PROGRAM_ARB) {
- ctx->FragmentProgram.Current = (struct fragment_program *) prog;
+ ctx->FragmentProgram.Current = (struct gl_fragment_program *) prog;
}
/* Never null pointers */
for (i = 0; i < n; i++) {
if (ids[i] != 0) {
- struct program *prog = (struct program *)
+ struct gl_program *prog = (struct gl_program *)
_mesa_HashLookup(ctx->Shared->Programs, ids[i]);
if (prog == &_mesa_DummyProgram) {
_mesa_HashRemove(ctx->Shared->Programs, ids[i]);
#define WRITEMASK_XYZW 0xf
-extern struct program _mesa_DummyProgram;
+extern struct gl_program _mesa_DummyProgram;
/*
GLint *line, GLint *col);
-extern struct program *
+extern struct gl_program *
_mesa_init_vertex_program(GLcontext *ctx,
- struct vertex_program *prog,
+ struct gl_vertex_program *prog,
GLenum target, GLuint id);
-extern struct program *
+extern struct gl_program *
_mesa_init_fragment_program(GLcontext *ctx,
- struct fragment_program *prog,
+ struct gl_fragment_program *prog,
GLenum target, GLuint id);
-extern struct program *
+extern struct gl_program *
_mesa_new_program(GLcontext *ctx, GLenum target, GLuint id);
extern void
-_mesa_delete_program(GLcontext *ctx, struct program *prog);
+_mesa_delete_program(GLcontext *ctx, struct gl_program *prog);
* and ARB_fragment_program global state references. For the later, Name
* might be "state.light[0].diffuse", for example.
*/
-struct program_parameter
+struct gl_program_parameter
{
const char *Name; /**< Null-terminated string */
enum register_file Type; /**< PROGRAM_NAMED_PARAM, CONSTANT or STATE_VAR */
/**
* A list of the above program_parameter instances.
*/
-struct program_parameter_list
+struct gl_program_parameter_list
{
GLuint Size; /**< allocated size of Parameters, ParameterValues */
GLuint NumParameters; /**< number of parameters in arrays */
- struct program_parameter *Parameters; /**< Array [Size] */
+ struct gl_program_parameter *Parameters; /**< Array [Size] */
GLfloat (*ParameterValues)[4]; /**< Array [Size] of GLfloat[4] */
GLbitfield StateFlags; /**< _NEW_* flags indicating which state changes
might invalidate ParameterValues[] */
* Program parameter functions
*/
-extern struct program_parameter_list *
+extern struct gl_program_parameter_list *
_mesa_new_parameter_list(void);
extern void
-_mesa_free_parameter_list(struct program_parameter_list *paramList);
+_mesa_free_parameter_list(struct gl_program_parameter_list *paramList);
extern GLint
-_mesa_add_named_parameter(struct program_parameter_list *paramList,
+_mesa_add_named_parameter(struct gl_program_parameter_list *paramList,
const char *name, const GLfloat values[4]);
extern GLint
-_mesa_add_named_constant(struct program_parameter_list *paramList,
+_mesa_add_named_constant(struct gl_program_parameter_list *paramList,
const char *name, const GLfloat values[4]);
extern GLint
-_mesa_add_unnamed_constant(struct program_parameter_list *paramList,
+_mesa_add_unnamed_constant(struct gl_program_parameter_list *paramList,
const GLfloat values[4]);
extern GLint
-_mesa_add_state_reference(struct program_parameter_list *paramList,
+_mesa_add_state_reference(struct gl_program_parameter_list *paramList,
const GLint *stateTokens);
extern GLfloat *
-_mesa_lookup_parameter_value(struct program_parameter_list *paramList,
+_mesa_lookup_parameter_value(struct gl_program_parameter_list *paramList,
GLsizei nameLen, const char *name);
extern GLint
-_mesa_lookup_parameter_index(struct program_parameter_list *paramList,
+_mesa_lookup_parameter_index(struct gl_program_parameter_list *paramList,
GLsizei nameLen, const char *name);
extern void
_mesa_load_state_parameters(GLcontext *ctx,
- struct program_parameter_list *paramList);
+ struct gl_program_parameter_list *paramList);
_mesa_print_instruction(const struct prog_instruction *inst);
extern void
-_mesa_print_program(const struct program *prog);
+_mesa_print_program(const struct gl_program *prog);
extern void
-_mesa_print_program_parameters(GLcontext *ctx, const struct program *prog);
+_mesa_print_program_parameters(GLcontext *ctx, const struct gl_program *prog);
/*
/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.1
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
swrast->_FogEnabled = GL_FALSE;
if (ctx->FragmentProgram._Active) {
if (ctx->FragmentProgram._Current->Base.Target==GL_FRAGMENT_PROGRAM_ARB) {
- const struct fragment_program *p
- = (struct fragment_program *) ctx->FragmentProgram._Current;
- if (p->FogOption != GL_NONE) {
+ const struct gl_fragment_program *fp
+ = ctx->FragmentProgram._Current;
+ if (fp->FogOption != GL_NONE) {
swrast->_FogEnabled = GL_TRUE;
- swrast->_FogMode = p->FogOption;
+ swrast->_FogMode = fp->FogOption;
}
}
}
_swrast_update_fragment_program( GLcontext *ctx )
{
if (ctx->FragmentProgram._Active) {
- const struct fragment_program *program = ctx->FragmentProgram._Current;
- _mesa_load_state_parameters(ctx, program->Base.Parameters);
+ const struct gl_fragment_program *fp = ctx->FragmentProgram._Current;
+ _mesa_load_state_parameters(ctx, fp->Base.Parameters);
}
}
get_register_pointer( GLcontext *ctx,
const struct prog_src_register *source,
const struct fp_machine *machine,
- const struct fragment_program *program )
+ const struct gl_fragment_program *program )
{
const GLfloat *src;
switch (source->File) {
fetch_vector4( GLcontext *ctx,
const struct prog_src_register *source,
const struct fp_machine *machine,
- const struct fragment_program *program,
+ const struct gl_fragment_program *program,
GLfloat result[4] )
{
const GLfloat *src = get_register_pointer(ctx, source, machine, program);
fetch_vector1( GLcontext *ctx,
const struct prog_src_register *source,
const struct fp_machine *machine,
- const struct fragment_program *program,
+ const struct gl_fragment_program *program,
GLfloat result[4] )
{
const GLfloat *src = get_register_pointer(ctx, source, machine, program);
static void
init_machine_deriv( GLcontext *ctx,
const struct fp_machine *machine,
- const struct fragment_program *program,
+ const struct gl_fragment_program *program,
const struct sw_span *span, char xOrY,
struct fp_machine *dMachine )
{
*/
static GLboolean
execute_program( GLcontext *ctx,
- const struct fragment_program *program, GLuint maxInst,
+ const struct gl_fragment_program *program, GLuint maxInst,
struct fp_machine *machine, const struct sw_span *span,
GLuint column )
{
static void
init_machine( GLcontext *ctx, struct fp_machine *machine,
- const struct fragment_program *program,
+ const struct gl_fragment_program *program,
const struct sw_span *span, GLuint col )
{
GLuint inputsRead = program->Base.InputsRead;
void
_swrast_exec_fragment_program( GLcontext *ctx, struct sw_span *span )
{
- const struct fragment_program *program = ctx->FragmentProgram._Current;
+ const struct gl_fragment_program *program = ctx->FragmentProgram._Current;
GLuint i;
ctx->_CurrentProgram = GL_FRAGMENT_PROGRAM_ARB; /* or NV, doesn't matter */
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct vertex_buffer *VB = &tnl->vb;
struct tnl_vertex_arrays *tmp = &tnl->array_inputs;
- const struct vertex_program *program
+ const struct gl_vertex_program *program
= ctx->VertexProgram._Enabled ? ctx->VertexProgram.Current : NULL;
GLuint i, index;
}
}
-static void free_tnl_data( struct vertex_program *program )
+static void free_tnl_data( struct gl_vertex_program *program )
{
struct tnl_compiled_program *p = (struct tnl_compiled_program *) program->TnlData;
if (p->compiled_func)
program->TnlData = NULL;
}
-static void compile_vertex_program( struct vertex_program *program,
+static void compile_vertex_program( struct gl_vertex_program *program,
GLboolean try_codegen )
{
struct compilation cp;
static GLboolean
run_arb_vertex_program(GLcontext *ctx, struct tnl_pipeline_stage *stage)
{
- const struct vertex_program *program;
+ const struct gl_vertex_program *program;
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
struct arb_vp_machine *m = ARB_VP_MACHINE(stage);
struct tnl_compiled_program *p;
validate_vertex_program( GLcontext *ctx, struct tnl_pipeline_stage *stage )
{
struct arb_vp_machine *m = ARB_VP_MACHINE(stage);
- struct vertex_program *program;
+ struct gl_vertex_program *program;
if (ctx->ShaderObjects._VertexShaderPresent)
return;
* string has been parsed.
*/
void
-_tnl_program_string(GLcontext *ctx, GLenum target, struct program *program)
+_tnl_program_string(GLcontext *ctx, GLenum target, struct gl_program *program)
{
if (program->Target == GL_VERTEX_PROGRAM_ARB) {
/* free any existing tnl data hanging off the program */
- struct vertex_program *vprog = (struct vertex_program *) program;
+ struct gl_vertex_program *vprog = (struct gl_vertex_program *) program;
if (vprog->TnlData) {
free_tnl_data(vprog);
}
void (*compiled_func)( struct arb_vp_machine * ); /**< codegen'd program */
};
-void _tnl_program_string_change( struct vertex_program * );
-void _tnl_program_destroy( struct vertex_program * );
+void _tnl_program_string_change( struct gl_vertex_program * );
+void _tnl_program_destroy( struct gl_vertex_program * );
void _tnl_disassem_vba_insn( union instruction op );
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct vp_stage_data *store = VP_STAGE_DATA(stage);
struct vertex_buffer *VB = &tnl->vb;
- struct vertex_program *program = ctx->VertexProgram.Current;
+ struct gl_vertex_program *program = ctx->VertexProgram.Current;
GLuint i;
if (ctx->ShaderObjects._VertexShaderPresent)
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct vertex_buffer *VB = &tnl->vb;
- const struct fragment_program *fp = ctx->FragmentProgram._Current;
+ const struct gl_fragment_program *fp = ctx->FragmentProgram._Current;
struct state_key *key = CALLOC_STRUCT(state_key);
GLuint i;
struct tnl_program {
const struct state_key *state;
- struct vertex_program *program;
+ struct gl_vertex_program *program;
GLuint temp_in_use;
GLuint temp_reserved;
static void
create_new_program( const struct state_key *key,
- struct vertex_program *program,
+ struct gl_vertex_program *program,
GLuint max_temps)
{
struct tnl_program p;
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct state_key *key;
GLuint hash;
- const struct vertex_program *prev = ctx->VertexProgram._Current;
+ const struct gl_vertex_program *prev = ctx->VertexProgram._Current;
if (ctx->VertexProgram._Enabled == GL_FALSE) {
/* Grab all the relevent state and put it in a single structure:
/* Look for an already-prepared program for this state:
*/
- ctx->_TnlProgram = (struct vertex_program *)
+ ctx->_TnlProgram = (struct gl_vertex_program *)
search_cache( tnl->vp_cache, hash, key, sizeof(*key) );
/* OK, we'll have to build a new one:
if (0)
_mesa_printf("Build new TNL program\n");
- ctx->_TnlProgram = (struct vertex_program *)
+ ctx->_TnlProgram = (struct gl_vertex_program *)
ctx->Driver.NewProgram(ctx, GL_VERTEX_PROGRAM_ARB, 0);
create_new_program( key, ctx->_TnlProgram,
*/
if (ctx->VertexProgram._Current != prev &&
ctx->Driver.BindProgram)
- ctx->Driver.BindProgram(ctx, GL_VERTEX_PROGRAM_ARB, (struct program *)
- ctx->VertexProgram._Current);
+ ctx->Driver.BindProgram(ctx, GL_VERTEX_PROGRAM_ARB,
+ (struct gl_program *) ctx->VertexProgram._Current);
}
void _tnl_ProgramCacheInit( GLcontext *ctx )
_tnl_allow_pixel_fog( GLcontext *ctx, GLboolean value );
extern void
-_tnl_program_string(GLcontext *ctx, GLenum target, struct program *program);
+_tnl_program_string(GLcontext *ctx, GLenum target, struct gl_program *program);
#endif