Ejemplo n.º 1
0
/**
 * Allocate a new gl_shader object, initialize it.
 * Called via ctx->Driver.NewShader()
 */
struct gl_shader *
_mesa_new_shader(struct gl_context *ctx, GLuint name, gl_shader_stage stage)
{
   struct gl_shader *shader;
   shader = rzalloc(NULL, struct gl_shader);
   if (shader) {
      shader->Stage = stage;
      shader->Name = name;
      _mesa_init_shader(ctx, shader);
   }
   return shader;
}
Ejemplo n.º 2
0
/**
 * Allocate a new gl_shader object, initialize it.
 * Called via ctx->Driver.NewShader()
 */
struct gl_shader *
_mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type)
{
   struct gl_shader *shader;
   assert(_mesa_validate_shader_target(ctx, type));
   shader = rzalloc(NULL, struct gl_shader);
   if (shader) {
      shader->Type = type;
      shader->Stage = _mesa_shader_enum_to_shader_stage(type);
      shader->Name = name;
      _mesa_init_shader(ctx, shader);
   }
   return shader;
}
Ejemplo n.º 3
0
/**
 * Allocate a new gl_shader object, initialize it.
 * Called via ctx->Driver.NewShader()
 */
struct gl_shader *
_mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type)
{
   struct gl_shader *shader;
   assert(type == GL_FRAGMENT_SHADER || type == GL_VERTEX_SHADER ||
          type == GL_GEOMETRY_SHADER_ARB);
   shader = rzalloc(NULL, struct gl_shader);
   if (shader) {
      shader->Type = type;
      shader->Name = name;
      _mesa_init_shader(ctx, shader);
   }
   return shader;
}
Ejemplo n.º 4
0
extern "C" struct gl_shader *
brw_new_shader(struct gl_context *ctx, GLuint name, GLuint type)
{
   struct brw_shader *shader;

   shader = rzalloc(NULL, struct brw_shader);
   if (shader) {
      shader->base.Type = type;
      shader->base.Stage = _mesa_shader_enum_to_shader_stage(type);
      shader->base.Name = name;
      _mesa_init_shader(ctx, &shader->base);
   }

   return &shader->base;
}
Ejemplo n.º 5
0
/**
 * Allocate a new gl_shader object, initialize it.
 */
struct gl_shader *
_mesa_new_shader(GLuint name, gl_shader_stage stage)
{
   struct gl_shader *shader;
   shader = rzalloc(NULL, struct gl_shader);
   if (shader) {
      shader->Stage = stage;
      shader->Name = name;
#ifdef DEBUG
      shader->SourceChecksum = 0xa110c; /* alloc */
#endif
      _mesa_init_shader(shader);
   }
   return shader;
}