summaryrefslogtreecommitdiff
path: root/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/context.c2
-rw-r--r--src/mesa/main/dd.h10
-rw-r--r--src/mesa/main/mtypes.h38
-rw-r--r--src/mesa/main/state.c2
-rw-r--r--src/mesa/main/texenvprogram.c17
5 files changed, 35 insertions, 34 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 61e1d8794a..b30d552362 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -829,7 +829,7 @@ delete_texture_cb(GLuint id, void *data, void *userData)
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);
}
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index 6675d56ed8..1b8cf6304e 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -583,20 +583,20 @@ struct dd_function_table {
*/
/*@{*/
/** 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);
/*@}*/
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index e2eeedf295..5e872d9dc3 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1517,7 +1517,7 @@ struct gl_texture_unit
struct texenvprog_cache_item {
GLuint hash;
void *key;
- struct fragment_program *data;
+ struct gl_fragment_program *data;
struct texenvprog_cache_item *next;
};
@@ -1843,13 +1843,13 @@ enum register_file
/** 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 */
@@ -1864,7 +1864,7 @@ struct program
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];
@@ -1888,19 +1888,19 @@ struct program
/** 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;
@@ -1932,8 +1932,8 @@ struct gl_vertex_program_state
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 */
@@ -1965,8 +1965,8 @@ struct gl_fragment_program_state
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 */
@@ -2096,10 +2096,10 @@ struct gl_shared_state
/*@{*/
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
/*@}*/
@@ -2920,8 +2920,8 @@ struct __GLcontextRec
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;
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 784757e91f..0b7214f9dd 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -955,7 +955,7 @@ update_program(GLcontext *ctx)
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
diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c
index 0a43f7ac4a..bce570b3b2 100644
--- a/src/mesa/main/texenvprogram.c
+++ b/src/mesa/main/texenvprogram.c
@@ -271,7 +271,7 @@ static const struct ureg undef = {
/* 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;
@@ -989,7 +989,7 @@ load_texunit_sources( struct texenv_fragment_program *p, int unit )
*/
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;
@@ -1103,7 +1103,7 @@ create_new_program(struct state_key *key, GLcontext *ctx,
}
-static struct fragment_program *
+static struct gl_fragment_program *
search_cache(const struct texenvprog_cache *cache,
GLuint hash,
const void *key,
@@ -1113,7 +1113,7 @@ search_cache(const struct texenvprog_cache *cache,
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;
@@ -1150,7 +1150,8 @@ static void clear_cache( struct texenvprog_cache *cache )
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;
@@ -1207,7 +1208,7 @@ void _mesa_UpdateTexEnvProgram( GLcontext *ctx )
{
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);
@@ -1221,7 +1222,7 @@ void _mesa_UpdateTexEnvProgram( GLcontext *ctx )
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);
@@ -1240,7 +1241,7 @@ void _mesa_UpdateTexEnvProgram( GLcontext *ctx )
*/
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);
}
}