mesa: Move GLES2 shader stubs to main/shaders.c
[mesa.git] / src / mesa / es / main / stubs.c
1 /**************************************************************************
2 *
3 * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * TUNGSTEN GRAPHICS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
21 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 **************************************************************************/
24
25
26 /**
27 * Temporary stubs for "missing" mesa functions.
28 */
29
30
31 #include "main/mtypes.h"
32 #include "main/imports.h"
33 #include "vbo/vbo.h"
34
35 #define NEED_IMPLEMENT() do { \
36 GET_CURRENT_CONTEXT(ctx); \
37 _mesa_error(ctx, GL_INVALID_OPERATION, __FUNCTION__); \
38 } while (0)
39
40
41 /* silence compiler warnings */
42 extern void GLAPIENTRY _vbo_Materialf(GLenum face, GLenum pname, GLfloat param);
43 extern void GLAPIENTRY _mesa_GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
44 extern void GLAPIENTRY _mesa_ReleaseShaderCompiler(void);
45 extern void GLAPIENTRY _mesa_ShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length);
46 extern void GLAPIENTRY _vbo_VertexAttrib1f(GLuint indx, GLfloat x);
47 extern void GLAPIENTRY _vbo_VertexAttrib1fv(GLuint indx, const GLfloat* values);
48 extern void GLAPIENTRY _vbo_VertexAttrib2f(GLuint indx, GLfloat x, GLfloat y);
49 extern void GLAPIENTRY _vbo_VertexAttrib2fv(GLuint indx, const GLfloat* values);
50 extern void GLAPIENTRY _vbo_VertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
51 extern void GLAPIENTRY _vbo_VertexAttrib3fv(GLuint indx, const GLfloat* values);
52 extern void GLAPIENTRY _vbo_VertexAttrib4fv(GLuint indx, const GLfloat* values);
53
54
55 void GLAPIENTRY
56 _vbo_Materialf(GLenum face, GLenum pname, GLfloat param)
57 {
58 _vbo_Materialfv(face, pname, &param);
59 }
60
61
62 void GLAPIENTRY
63 _vbo_VertexAttrib1f(GLuint indx, GLfloat x)
64 {
65 _vbo_VertexAttrib4f(indx, x, 0.0, 0.0, 1.0f);
66 }
67
68
69 void GLAPIENTRY
70 _vbo_VertexAttrib1fv(GLuint indx, const GLfloat* values)
71 {
72 _vbo_VertexAttrib4f(indx, values[0], 0.0, 0.0, 1.0f);
73 }
74
75
76 void GLAPIENTRY
77 _vbo_VertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
78 {
79 _vbo_VertexAttrib4f(indx, x, y, 0.0, 1.0f);
80 }
81
82
83 void GLAPIENTRY
84 _vbo_VertexAttrib2fv(GLuint indx, const GLfloat* values)
85 {
86 _vbo_VertexAttrib4f(indx, values[0], values[1], 0.0, 1.0f);
87 }
88
89
90 void GLAPIENTRY
91 _vbo_VertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
92 {
93 _vbo_VertexAttrib4f(indx, x, y, z, 1.0f);
94 }
95
96
97 void GLAPIENTRY
98 _vbo_VertexAttrib3fv(GLuint indx, const GLfloat* values)
99 {
100 _vbo_VertexAttrib4f(indx, values[0], values[1], values[2], 1.0f);
101 }
102
103
104 void GLAPIENTRY
105 _vbo_VertexAttrib4fv(GLuint indx, const GLfloat* values)
106 {
107 _vbo_VertexAttrib4f(indx, values[0], values[1], values[2], values[3]);
108 }