#include "main/glheader.h"
#include "main/context.h"
#include "main/hash.h"
-#include "main/mfeatures.h"
#include "main/mtypes.h"
#include "main/shaderobj.h"
#include "main/uniforms.h"
static void
_mesa_delete_shader(struct gl_context *ctx, struct gl_shader *sh)
{
- if (sh->Source)
- free((void *) sh->Source);
+ free((void *)sh->Source);
_mesa_reference_program(ctx, &sh->Program, NULL);
ralloc_free(sh);
}
prog->FragDataBindings = string_to_uint_map_ctor();
prog->FragDataIndexBindings = string_to_uint_map_ctor();
-#if FEATURE_ARB_geometry_shader4
prog->Geom.VerticesOut = 0;
prog->Geom.InputType = GL_TRIANGLES;
prog->Geom.OutputType = GL_TRIANGLE_STRIP;
-#endif
+
+ prog->TransformFeedback.BufferMode = GL_INTERLEAVED_ATTRIBS;
prog->InfoLog = ralloc_strdup(prog, "");
}
struct gl_shader_program *shProg)
{
if (shProg->UniformStorage) {
- for (unsigned i = 0; i < shProg->NumUserUniformStorage; ++i)
+ unsigned i;
+ for (i = 0; i < shProg->NumUserUniformStorage; ++i)
_mesa_uniform_detach_all_driver_storage(&shProg->UniformStorage[i]);
ralloc_free(shProg->UniformStorage);
shProg->NumUserUniformStorage = 0;
}
shProg->NumShaders = 0;
- if (shProg->Shaders) {
- free(shProg->Shaders);
- shProg->Shaders = NULL;
- }
+ free(shProg->Shaders);
+ shProg->Shaders = NULL;
/* Transform feedback varying vars */
for (i = 0; i < shProg->TransformFeedback.NumVarying; i++) {