blob: 52704856ab08e647e7f46eeeb5b390f03f449669 [file] [log] [blame]
Michal Krol2861e732004-03-29 11:09:34 +00001/*
2 * Mesa 3-D graphics library
Brian942ee022007-02-09 15:40:00 -07003 * Version: 6.5.3
Michal Krol2861e732004-03-29 11:09:34 +00004 *
Brian942ee022007-02-09 15:40:00 -07005 * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
Michal Krol2861e732004-03-29 11:09:34 +00006 *
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25/**
26 * \file program.c
27 * Vertex and fragment program support functions.
28 * \author Brian Paul
29 */
30
31
Brian Paul253204f2004-09-10 00:45:12 +000032/**
33 * \mainpage Mesa vertex and fragment program module
34 *
35 * This module or directory contains most of the code for vertex and
36 * fragment programs and shaders, including state management, parsers,
37 * and (some) software routines for executing programs
38 */
39
Michal Krol2861e732004-03-29 11:09:34 +000040#ifndef PROGRAM_H
41#define PROGRAM_H
42
43#include "mtypes.h"
44
45
Brian Paul122629f2006-07-20 16:49:57 +000046extern struct gl_program _mesa_DummyProgram;
Brian Paul9ca83922004-10-02 15:16:59 +000047
48
Michal Krol2861e732004-03-29 11:09:34 +000049/*
50 * Internal functions
51 */
52
53extern void
54_mesa_init_program(GLcontext *ctx);
55
56extern void
Brian Paul21841f02004-08-14 14:28:11 +000057_mesa_free_program_data(GLcontext *ctx);
58
59extern void
Michal Krol2861e732004-03-29 11:09:34 +000060_mesa_set_program_error(GLcontext *ctx, GLint pos, const char *string);
61
62extern const GLubyte *
63_mesa_find_line_column(const GLubyte *string, const GLubyte *pos,
64 GLint *line, GLint *col);
65
66
Brian Paul122629f2006-07-20 16:49:57 +000067extern struct gl_program *
Brian Paulcdb65412005-01-11 15:56:47 +000068_mesa_init_vertex_program(GLcontext *ctx,
Brian Paul122629f2006-07-20 16:49:57 +000069 struct gl_vertex_program *prog,
Brian Paulcdb65412005-01-11 15:56:47 +000070 GLenum target, GLuint id);
Michal Krol2861e732004-03-29 11:09:34 +000071
Brian Paul122629f2006-07-20 16:49:57 +000072extern struct gl_program *
Brian Paulcdb65412005-01-11 15:56:47 +000073_mesa_init_fragment_program(GLcontext *ctx,
Brian Paul122629f2006-07-20 16:49:57 +000074 struct gl_fragment_program *prog,
Brian Paulcdb65412005-01-11 15:56:47 +000075 GLenum target, GLuint id);
76
Brian Paul122629f2006-07-20 16:49:57 +000077extern struct gl_program *
Michal Krol2861e732004-03-29 11:09:34 +000078_mesa_new_program(GLcontext *ctx, GLenum target, GLuint id);
79
80extern void
Brian Paul122629f2006-07-20 16:49:57 +000081_mesa_delete_program(GLcontext *ctx, struct gl_program *prog);
Michal Krol2861e732004-03-29 11:09:34 +000082
Brian Paul4d12a052006-08-23 23:10:14 +000083extern struct gl_program *
84_mesa_lookup_program(GLcontext *ctx, GLuint id);
Michal Krol2861e732004-03-29 11:09:34 +000085
Brian Paul3b9b8de2006-08-24 21:57:36 +000086
Brianb2a3a852006-12-14 13:56:58 -070087extern struct gl_program *
88_mesa_clone_program(GLcontext *ctx, const struct gl_program *prog);
89
Michal Krol2861e732004-03-29 11:09:34 +000090
Michal Krol2861e732004-03-29 11:09:34 +000091/*
Brian Paulfd4395b2005-11-05 03:02:28 +000092 * API functions common to ARB/NV_vertex/fragment_program
Michal Krol2861e732004-03-29 11:09:34 +000093 */
94
95extern void GLAPIENTRY
96_mesa_BindProgram(GLenum target, GLuint id);
97
98extern void GLAPIENTRY
99_mesa_DeletePrograms(GLsizei n, const GLuint *ids);
100
101extern void GLAPIENTRY
102_mesa_GenPrograms(GLsizei n, GLuint *ids);
103
Michal Krol2861e732004-03-29 11:09:34 +0000104
105
Michal Krol2861e732004-03-29 11:09:34 +0000106#endif /* PROGRAM_H */