diff options
author | marha <marha@users.sourceforge.net> | 2010-11-22 19:42:40 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-11-22 19:42:40 +0000 |
commit | 85ef9930f56bf15181f9a0b238f03d55303cf411 (patch) | |
tree | 63b43286956ebd1c35c96e9b3d5305aabdf71a0f /mesalib/src/mesa/main/state.c | |
parent | 94810d19989336862251dbf69c3f3acb18a9b06d (diff) | |
download | vcxsrv-85ef9930f56bf15181f9a0b238f03d55303cf411.tar.gz vcxsrv-85ef9930f56bf15181f9a0b238f03d55303cf411.tar.bz2 vcxsrv-85ef9930f56bf15181f9a0b238f03d55303cf411.zip |
Updated to mesalib 7.9
Diffstat (limited to 'mesalib/src/mesa/main/state.c')
-rw-r--r-- | mesalib/src/mesa/main/state.c | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/mesalib/src/mesa/main/state.c b/mesalib/src/mesa/main/state.c index b971cc976..4a3dffe4c 100644 --- a/mesalib/src/mesa/main/state.c +++ b/mesalib/src/mesa/main/state.c @@ -41,8 +41,8 @@ #include "light.h" #include "matrix.h" #include "pixel.h" -#include "shader/program.h" -#include "shader/prog_parameter.h" +#include "program/program.h" +#include "program/prog_parameter.h" #include "state.h" #include "stencil.h" #include "texenvprogram.h" @@ -250,6 +250,7 @@ update_program(GLcontext *ctx) const struct gl_shader_program *shProg = ctx->Shader.CurrentProgram; const struct gl_vertex_program *prevVP = ctx->VertexProgram._Current; const struct gl_fragment_program *prevFP = ctx->FragmentProgram._Current; + const struct gl_geometry_program *prevGP = ctx->GeometryProgram._Current; GLbitfield new_state = 0x0; /* @@ -291,6 +292,15 @@ update_program(GLcontext *ctx) _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, NULL); } + if (shProg && shProg->LinkStatus && shProg->GeometryProgram) { + /* Use shader programs */ + _mesa_reference_geomprog(ctx, &ctx->GeometryProgram._Current, + shProg->GeometryProgram); + } else { + /* no fragment program */ + _mesa_reference_geomprog(ctx, &ctx->GeometryProgram._Current, NULL); + } + /* Examine vertex program after fragment program as * _mesa_get_fixed_func_vertex_program() needs to know active * fragprog inputs. @@ -327,7 +337,15 @@ update_program(GLcontext *ctx) (struct gl_program *) ctx->FragmentProgram._Current); } } - + + if (ctx->GeometryProgram._Current != prevGP) { + new_state |= _NEW_PROGRAM; + if (ctx->Driver.BindProgram) { + ctx->Driver.BindProgram(ctx, MESA_GEOMETRY_PROGRAM, + (struct gl_program *) ctx->GeometryProgram._Current); + } + } + if (ctx->VertexProgram._Current != prevVP) { new_state |= _NEW_PROGRAM; if (ctx->Driver.BindProgram) { @@ -356,6 +374,16 @@ update_program_constants(GLcontext *ctx) } } + if (ctx->GeometryProgram._Current) { + const struct gl_program_parameter_list *params = + ctx->GeometryProgram._Current->Base.Parameters; + /*FIXME: StateFlags is always 0 because we have unnamed constant + * not state changes */ + if (params /*&& params->StateFlags & ctx->NewState*/) { + new_state |= _NEW_PROGRAM_CONSTANTS; + } + } + if (ctx->VertexProgram._Current) { const struct gl_program_parameter_list *params = ctx->VertexProgram._Current->Base.Parameters; @@ -537,7 +565,7 @@ _mesa_update_state_locked( GLcontext *ctx ) /* Determine which state flags effect vertex/fragment program state */ if (ctx->FragmentProgram._MaintainTexEnvProgram) { - prog_flags |= (_NEW_TEXTURE | _NEW_FOG | + prog_flags |= (_NEW_BUFFERS | _NEW_TEXTURE | _NEW_FOG | _NEW_ARRAY | _NEW_LIGHT | _NEW_POINT | _NEW_RENDERMODE | _NEW_PROGRAM); } |