* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
- _TNL_ATTRIB_GENERIC0 = 16, /* doesn't really exist! */
- _TNL_ATTRIB_GENERIC1 = 17,
- _TNL_ATTRIB_GENERIC2 = 18,
- _TNL_ATTRIB_GENERIC3 = 19,
- _TNL_ATTRIB_GENERIC4 = 20,
- _TNL_ATTRIB_GENERIC5 = 21,
- _TNL_ATTRIB_GENERIC6 = 22,
- _TNL_ATTRIB_GENERIC7 = 23,
- _TNL_ATTRIB_GENERIC8 = 24,
- _TNL_ATTRIB_GENERIC9 = 25,
- _TNL_ATTRIB_GENERIC10 = 26,
- _TNL_ATTRIB_GENERIC11 = 27,
- _TNL_ATTRIB_GENERIC12 = 28,
- _TNL_ATTRIB_GENERIC13 = 29,
- _TNL_ATTRIB_GENERIC14 = 30,
- _TNL_ATTRIB_GENERIC15 = 31,
+ _TNL_ATTRIB_GENERIC0 = 17, /* doesn't really exist! */
+ _TNL_ATTRIB_GENERIC1 = 18,
+ _TNL_ATTRIB_GENERIC2 = 19,
+ _TNL_ATTRIB_GENERIC3 = 20,
+ _TNL_ATTRIB_GENERIC4 = 21,
+ _TNL_ATTRIB_GENERIC5 = 22,
+ _TNL_ATTRIB_GENERIC6 = 23,
+ _TNL_ATTRIB_GENERIC7 = 24,
+ _TNL_ATTRIB_GENERIC8 = 25,
+ _TNL_ATTRIB_GENERIC9 = 26,
+ _TNL_ATTRIB_GENERIC10 = 27,
+ _TNL_ATTRIB_GENERIC11 = 28,
+ _TNL_ATTRIB_GENERIC12 = 29,
+ _TNL_ATTRIB_GENERIC13 = 30,
+ _TNL_ATTRIB_GENERIC14 = 31,
+ _TNL_ATTRIB_GENERIC15 = 32,
/* These alias with the generics, but they are not active
* concurrently, so it's not a problem. The TNL module
/* These alias with the generics, but they are not active
* concurrently, so it's not a problem. The TNL module
- _TNL_ATTRIB_MAT_FRONT_AMBIENT = 16,
- _TNL_ATTRIB_MAT_BACK_AMBIENT = 17,
- _TNL_ATTRIB_MAT_FRONT_DIFFUSE = 18,
- _TNL_ATTRIB_MAT_BACK_DIFFUSE = 19,
- _TNL_ATTRIB_MAT_FRONT_SPECULAR = 20,
- _TNL_ATTRIB_MAT_BACK_SPECULAR = 21,
- _TNL_ATTRIB_MAT_FRONT_EMISSION = 22,
- _TNL_ATTRIB_MAT_BACK_EMISSION = 23,
- _TNL_ATTRIB_MAT_FRONT_SHININESS = 24,
- _TNL_ATTRIB_MAT_BACK_SHININESS = 25,
- _TNL_ATTRIB_MAT_FRONT_INDEXES = 26,
- _TNL_ATTRIB_MAT_BACK_INDEXES = 27,
-
- /* This is really a VERT_RESULT, not an attrib. Need to fix
+ _TNL_ATTRIB_MAT_FRONT_AMBIENT = 17,
+ _TNL_ATTRIB_MAT_BACK_AMBIENT = 18,
+ _TNL_ATTRIB_MAT_FRONT_DIFFUSE = 19,
+ _TNL_ATTRIB_MAT_BACK_DIFFUSE = 20,
+ _TNL_ATTRIB_MAT_FRONT_SPECULAR = 21,
+ _TNL_ATTRIB_MAT_BACK_SPECULAR = 22,
+ _TNL_ATTRIB_MAT_FRONT_EMISSION = 23,
+ _TNL_ATTRIB_MAT_BACK_EMISSION = 24,
+ _TNL_ATTRIB_MAT_FRONT_SHININESS = 25,
+ _TNL_ATTRIB_MAT_BACK_SHININESS = 26,
+ _TNL_ATTRIB_MAT_FRONT_INDEXES = 27,
+ _TNL_ATTRIB_MAT_BACK_INDEXES = 28,
+
+ /* This is really a VARYING_SLOT, not an attrib. Need to fix
- /* Pointers to current data.
- * XXX some of these fields alias AttribPtr below and should be removed
- * such as NormalPtr, TexCoordPtr, FogCoordPtr, etc.
+ /* Pointers to current data. Most of the data is in AttribPtr -- all of
+ * it that is one of VERT_ATTRIB_X. For things only produced by TNL,
+ * such as backface color or eye-space coordinates, they are stored
+ * here.
GLvector4f *EyePtr; /* _TNL_BIT_POS */
GLvector4f *ClipPtr; /* _TNL_BIT_POS */
GLvector4f *NdcPtr; /* _TNL_BIT_POS */
GLvector4f *EyePtr; /* _TNL_BIT_POS */
GLvector4f *ClipPtr; /* _TNL_BIT_POS */
GLvector4f *NdcPtr; /* _TNL_BIT_POS */
GLubyte ClipOrMask; /* _TNL_BIT_POS */
GLubyte ClipAndMask; /* _TNL_BIT_POS */
GLubyte *ClipMask; /* _TNL_BIT_POS */
GLubyte ClipOrMask; /* _TNL_BIT_POS */
GLubyte ClipAndMask; /* _TNL_BIT_POS */
GLubyte *ClipMask; /* _TNL_BIT_POS */
- GLvector4f *TexCoordPtr[MAX_TEXTURE_COORD_UNITS]; /* VERT_TEX_0..n */
- GLvector4f *IndexPtr[2]; /* _TNL_BIT_INDEX */
- GLvector4f *ColorPtr[2]; /* _TNL_BIT_COLOR0 */
- GLvector4f *SecondaryColorPtr[2]; /* _TNL_BIT_COLOR1 */
- GLvector4f *FogCoordPtr; /* _TNL_BIT_FOG */
+ GLvector4f *BackfaceIndexPtr;
+ GLvector4f *BackfaceColorPtr;
+ GLvector4f *BackfaceSecondaryColorPtr;
-typedef void (*tnl_points_func)( GLcontext *ctx, GLuint first, GLuint last );
-typedef void (*tnl_line_func)( GLcontext *ctx, GLuint v1, GLuint v2 );
-typedef void (*tnl_triangle_func)( GLcontext *ctx,
+typedef void (*tnl_points_func)( struct gl_context *ctx, GLuint first, GLuint last );
+typedef void (*tnl_line_func)( struct gl_context *ctx, GLuint v1, GLuint v2 );
+typedef void (*tnl_triangle_func)( struct gl_context *ctx,
GLfloat t, GLuint dst, GLuint out, GLuint in,
GLboolean force_boundary );
GLfloat t, GLuint dst, GLuint out, GLuint in,
GLboolean force_boundary );
-typedef void (*tnl_copy_pv_func)( GLcontext *ctx, GLuint dst, GLuint src );
-typedef void (*tnl_setup_func)( GLcontext *ctx,
+typedef void (*tnl_copy_pv_func)( struct gl_context *ctx, GLuint dst, GLuint src );
+typedef void (*tnl_setup_func)( struct gl_context *ctx,
- void (*codegen_emit)( GLcontext *ctx );
+ void (*codegen_emit)( struct gl_context *ctx );
+};
+
+
+#define SHINE_TABLE_SIZE 256 /**< Material shininess lookup table sizes */
+
+/**
+ * Material shininess lookup table.
+ */
+struct tnl_shine_tab
+{
+ struct tnl_shine_tab *next, *prev;
+ GLfloat tab[SHINE_TABLE_SIZE+1];
+ GLfloat shininess;
+ GLuint refcount;
/* Replaces PipelineStart/PipelineFinish -- intended to allow
* drivers to wrap _tnl_run_pipeline() with code to validate state
* and grab/release hardware locks.
*/
/* Replaces PipelineStart/PipelineFinish -- intended to allow
* drivers to wrap _tnl_run_pipeline() with code to validate state
* and grab/release hardware locks.
*/
/* Called before and after all rendering operations, including DrawPixels,
* ReadPixels, Bitmap, span functions, and CopyTexImage, etc commands.
* These are a suitable place for grabbing/releasing hardware locks.
*/
/* Called before and after all rendering operations, including DrawPixels,
* ReadPixels, Bitmap, span functions, and CopyTexImage, etc commands.
* These are a suitable place for grabbing/releasing hardware locks.
*/
/* Called between RenderStart() and RenderFinish() to indicate the
* type of primitive we're about to draw. Mode will be one of the
* modes accepted by glBegin().
/* Called between RenderStart() and RenderFinish() to indicate the
* type of primitive we're about to draw. Mode will be one of the
* modes accepted by glBegin().
/* Driver may request additional render passes by returning GL_TRUE
* when this function is called. This function will be called
* after the first pass, and passes will be made until the function
/* Driver may request additional render passes by returning GL_TRUE
* when this function is called. This function will be called
* after the first pass, and passes will be made until the function
-#define DECLARE_RENDERINPUTS(name) BITSET64_DECLARE(name, _TNL_ATTRIB_MAX)
-#define RENDERINPUTS_COPY BITSET64_COPY
-#define RENDERINPUTS_EQUAL BITSET64_EQUAL
-#define RENDERINPUTS_ZERO BITSET64_ZERO
-#define RENDERINPUTS_ONES BITSET64_ONES
-#define RENDERINPUTS_TEST BITSET64_TEST
-#define RENDERINPUTS_SET BITSET64_SET
-#define RENDERINPUTS_CLEAR BITSET64_CLEAR
-#define RENDERINPUTS_TEST_RANGE BITSET64_TEST_RANGE
-#define RENDERINPUTS_SET_RANGE BITSET64_SET_RANGE
-#define RENDERINPUTS_CLEAR_RANGE BITSET64_CLEAR_RANGE
-
-