aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/program/program.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-07-31 10:17:14 +0200
committermarha <marha@users.sourceforge.net>2012-07-31 10:17:14 +0200
commit83da3ad0287bc51cd16ee6911fe73dc98ebe000b (patch)
tree48d48590a0b0a3770006aeda8ec2b2a45054d1f1 /mesalib/src/mesa/program/program.c
parent00e30605ffc7ac3cf1a091ff2c1f46cfefb780d7 (diff)
parentbd27b3d008b0abf9ae2edcb127302728808533e4 (diff)
downloadvcxsrv-83da3ad0287bc51cd16ee6911fe73dc98ebe000b.tar.gz
vcxsrv-83da3ad0287bc51cd16ee6911fe73dc98ebe000b.tar.bz2
vcxsrv-83da3ad0287bc51cd16ee6911fe73dc98ebe000b.zip
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/mesa/program/program.c')
-rw-r--r--mesalib/src/mesa/program/program.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/mesalib/src/mesa/program/program.c b/mesalib/src/mesa/program/program.c
index 582cbccf8..15337f4d8 100644
--- a/mesalib/src/mesa/program/program.c
+++ b/mesalib/src/mesa/program/program.c
@@ -169,22 +169,19 @@ _mesa_update_default_objects_program(struct gl_context *ctx)
{
#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program
_mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current,
- (struct gl_vertex_program *)
ctx->Shared->DefaultVertexProgram);
assert(ctx->VertexProgram.Current);
#endif
#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program
_mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current,
- (struct gl_fragment_program *)
ctx->Shared->DefaultFragmentProgram);
assert(ctx->FragmentProgram.Current);
#endif
#if FEATURE_ARB_geometry_shader4
_mesa_reference_geomprog(ctx, &ctx->GeometryProgram.Current,
- (struct gl_geometry_program *)
- ctx->Shared->DefaultGeometryProgram);
+ ctx->Shared->DefaultGeometryProgram);
#endif
/* XXX probably move this stuff */
@@ -538,28 +535,26 @@ _mesa_clone_program(struct gl_context *ctx, const struct gl_program *prog)
switch (prog->Target) {
case GL_VERTEX_PROGRAM_ARB:
{
- const struct gl_vertex_program *vp
- = (const struct gl_vertex_program *) prog;
- struct gl_vertex_program *vpc = (struct gl_vertex_program *) clone;
+ const struct gl_vertex_program *vp = gl_vertex_program_const(prog);
+ struct gl_vertex_program *vpc = gl_vertex_program(clone);
vpc->IsPositionInvariant = vp->IsPositionInvariant;
vpc->IsNVProgram = vp->IsNVProgram;
}
break;
case GL_FRAGMENT_PROGRAM_ARB:
{
- const struct gl_fragment_program *fp
- = (const struct gl_fragment_program *) prog;
- struct gl_fragment_program *fpc = (struct gl_fragment_program *) clone;
+ const struct gl_fragment_program *fp = gl_fragment_program_const(prog);
+ struct gl_fragment_program *fpc = gl_fragment_program(clone);
fpc->UsesKill = fp->UsesKill;
+ fpc->UsesDFdy = fp->UsesDFdy;
fpc->OriginUpperLeft = fp->OriginUpperLeft;
fpc->PixelCenterInteger = fp->PixelCenterInteger;
}
break;
case MESA_GEOMETRY_PROGRAM:
{
- const struct gl_geometry_program *gp
- = (const struct gl_geometry_program *) prog;
- struct gl_geometry_program *gpc = (struct gl_geometry_program *) clone;
+ const struct gl_geometry_program *gp = gl_geometry_program_const(prog);
+ struct gl_geometry_program *gpc = gl_geometry_program(clone);
gpc->VerticesOut = gp->VerticesOut;
gpc->InputType = gp->InputType;
gpc->OutputType = gp->OutputType;
@@ -763,15 +758,17 @@ _mesa_combine_programs(struct gl_context *ctx,
usedTemps, MAX_PROGRAM_TEMPS);
if (newProg->Target == GL_FRAGMENT_PROGRAM_ARB) {
- struct gl_fragment_program *fprogA, *fprogB, *newFprog;
+ const struct gl_fragment_program *fprogA, *fprogB;
+ struct gl_fragment_program *newFprog;
GLbitfield progB_inputsRead = progB->InputsRead;
GLint progB_colorFile, progB_colorIndex;
- fprogA = (struct gl_fragment_program *) progA;
- fprogB = (struct gl_fragment_program *) progB;
- newFprog = (struct gl_fragment_program *) newProg;
+ fprogA = gl_fragment_program_const(progA);
+ fprogB = gl_fragment_program_const(progB);
+ newFprog = gl_fragment_program(newProg);
newFprog->UsesKill = fprogA->UsesKill || fprogB->UsesKill;
+ newFprog->UsesDFdy = fprogA->UsesDFdy || fprogB->UsesDFdy;
/* We'll do a search and replace for instances
* of progB_colorFile/progB_colorIndex below...