break;
case GL_GEOMETRY_SHADER_ARB:
- _mesa_append_uniforms_to_file(sh,
- &shProg[i]->GeometryProgram->Base);
+ _mesa_append_uniforms_to_file(sh, sh->Program);
break;
case GL_FRAGMENT_SHADER:
/* post-link info: */
struct gl_fragment_program *FragmentProgram; /**< Linked fragment prog */
- struct gl_geometry_program *GeometryProgram; /**< Linked geometry prog */
struct gl_uniform_list *Uniforms;
struct gl_program_parameter_list *Varying;
GLboolean LinkStatus; /**< GL_LINK_STATUS */
shProg->_LinkedShaders[MESA_SHADER_VERTEX]->Program->Id);
if (shProg->FragmentProgram)
printf(" frag prog %u\n", shProg->FragmentProgram->Base.Id);
- if (shProg->GeometryProgram)
- printf(" geom prog %u\n", shProg->GeometryProgram->Base.Id);
+ if (shProg->_LinkedShaders[MESA_SHADER_GEOMETRY])
+ printf(" geom prog %u\n",
+ shProg->_LinkedShaders[MESA_SHADER_GEOMETRY]->Program->Id);
}
char *errMsg)
{
const struct gl_shader *vs = shProg->_LinkedShaders[MESA_SHADER_VERTEX];
- const struct gl_geometry_program *gp = shProg->GeometryProgram;
+ const struct gl_shader *gs = shProg->_LinkedShaders[MESA_SHADER_GEOMETRY];
const struct gl_fragment_program *fp = shProg->FragmentProgram;
if (!shProg->LinkStatus) {
if (vs && !validate_samplers(vs->Program, errMsg)) {
return GL_FALSE;
}
- if (gp && !validate_samplers(&gp->Base, errMsg)) {
+ if (gs && !validate_samplers(gs->Program, errMsg)) {
return GL_FALSE;
}
if (fp && !validate_samplers(&fp->Base, errMsg)) {
struct gl_shader_program *shProg)
{
_mesa_reference_fragprog(ctx, &shProg->FragmentProgram, NULL);
- _mesa_reference_geomprog(ctx, &shProg->GeometryProgram, NULL);
if (shProg->Uniforms) {
_mesa_free_uniform_list(shProg->Uniforms);
_mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, NULL);
}
- if (gsProg && gsProg->LinkStatus && gsProg->GeometryProgram) {
+ if (gsProg && gsProg->LinkStatus
+ && gsProg->_LinkedShaders[MESA_SHADER_GEOMETRY]) {
/* Use GLSL geometry shader */
_mesa_reference_geomprog(ctx, &ctx->GeometryProgram._Current,
- gsProg->GeometryProgram);
+ (struct gl_geometry_program *)
+ gsProg->_LinkedShaders[MESA_SHADER_GEOMETRY]->Program);
} else {
/* No geometry program */
_mesa_reference_geomprog(ctx, &ctx->GeometryProgram._Current, NULL);
else {
pos = shProg->Uniforms->Uniforms[index].GeomPos;
if (pos >= 0) {
- prog = &shProg->GeometryProgram->Base;
+ prog = shProg->_LinkedShaders[MESA_SHADER_GEOMETRY]->Program;
}
}
}
}
}
- if (shProg->GeometryProgram) {
+ if (shProg->_LinkedShaders[MESA_SHADER_GEOMETRY]) {
/* convert uniform location to program parameter index */
GLint index = uniform->GeomPos;
if (index >= 0) {
- set_program_uniform(ctx, &shProg->GeometryProgram->Base,
+ set_program_uniform(ctx,
+ shProg->_LinkedShaders[MESA_SHADER_GEOMETRY]->Program,
index, offset, type, count, elems, values);
}
}
}
}
- if (shProg->GeometryProgram) {
+ if (shProg->_LinkedShaders[MESA_SHADER_GEOMETRY]) {
/* convert uniform location to program parameter index */
GLint index = uniform->GeomPos;
if (index >= 0) {
- set_program_uniform_matrix(ctx, &shProg->GeometryProgram->Base,
+ set_program_uniform_matrix(ctx,
+ shProg->_LinkedShaders[MESA_SHADER_GEOMETRY]->Program,
index, offset,
count, rows, cols, transpose, values);
}
linked_prog);
break;
case GL_GEOMETRY_SHADER:
- _mesa_reference_geomprog(ctx, &prog->GeometryProgram,
- (struct gl_geometry_program *)linked_prog);
+ _mesa_reference_program(ctx, &prog->_LinkedShaders[i]->Program,
+ linked_prog);
ok = ctx->Driver.ProgramStringNotify(ctx, GL_GEOMETRY_PROGRAM_NV,
linked_prog);
break;
}
_mesa_reference_fragprog(ctx, &prog->FragmentProgram, NULL);
- _mesa_reference_geomprog(ctx, &prog->GeometryProgram, NULL);
if (prog->LinkStatus) {
link_shaders(ctx, prog);
}
break;
case GL_GEOMETRY_SHADER:
- _mesa_reference_geomprog(ctx, &prog->GeometryProgram,
- (struct gl_geometry_program *)linked_prog);
+ _mesa_reference_program(ctx, &prog->_LinkedShaders[i]->Program,
+ linked_prog);
ok = ctx->Driver.ProgramStringNotify(ctx, GL_GEOMETRY_PROGRAM_NV,
linked_prog);
if (!ok) {
shProg->_LinkedShaders[MESA_SHADER_VERTEX]->Program);
destroy_program_variants(st, (struct gl_program *)
shProg->FragmentProgram);
- destroy_program_variants(st, (struct gl_program *)
- shProg->GeometryProgram);
+ destroy_program_variants(st,
+ shProg->_LinkedShaders[MESA_SHADER_GEOMETRY]->Program);
}
break;
case GL_VERTEX_SHADER: