From 209657f69055b17b00c3db3f99c7f411a6e8d176 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Fri, 17 Feb 2017 16:11:01 +0100 Subject: nx-X11/extras/Mesa: Drop bundled Mesa, place a symlink to imported Git subtree of Mesa_6.4.1 instead. --- .../extras/Mesa/src/mesa/swrast_setup/ss_context.c | 250 ---------------- .../extras/Mesa/src/mesa/swrast_setup/ss_context.h | 45 --- .../Mesa/src/mesa/swrast_setup/ss_triangle.c | 314 --------------------- .../Mesa/src/mesa/swrast_setup/ss_triangle.h | 39 --- .../extras/Mesa/src/mesa/swrast_setup/ss_tritmp.h | 222 --------------- .../Mesa/src/mesa/swrast_setup/swrast_setup.h | 61 ---- 6 files changed, 931 deletions(-) delete mode 100644 nx-X11/extras/Mesa/src/mesa/swrast_setup/ss_context.c delete mode 100644 nx-X11/extras/Mesa/src/mesa/swrast_setup/ss_context.h delete mode 100644 nx-X11/extras/Mesa/src/mesa/swrast_setup/ss_triangle.c delete mode 100644 nx-X11/extras/Mesa/src/mesa/swrast_setup/ss_triangle.h delete mode 100644 nx-X11/extras/Mesa/src/mesa/swrast_setup/ss_tritmp.h delete mode 100644 nx-X11/extras/Mesa/src/mesa/swrast_setup/swrast_setup.h (limited to 'nx-X11/extras/Mesa/src/mesa/swrast_setup') diff --git a/nx-X11/extras/Mesa/src/mesa/swrast_setup/ss_context.c b/nx-X11/extras/Mesa/src/mesa/swrast_setup/ss_context.c deleted file mode 100644 index c63646ca9..000000000 --- a/nx-X11/extras/Mesa/src/mesa/swrast_setup/ss_context.c +++ /dev/null @@ -1,250 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.1 - * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * 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. - * - * Authors: - * Keith Whitwell - */ - -#include "glheader.h" -#include "imports.h" -#include "colormac.h" -#include "ss_context.h" -#include "ss_triangle.h" -#include "swrast_setup.h" -#include "tnl/tnl.h" -#include "tnl/t_context.h" -#include "tnl/t_pipeline.h" -#include "tnl/t_vertex.h" - -/* Need to check lighting state and vertex program state to know - * if two-sided lighting is in effect. - */ -#define _SWSETUP_NEW_RENDERINDEX (_NEW_POLYGON|_NEW_LIGHT|_NEW_PROGRAM) - - -GLboolean -_swsetup_CreateContext( GLcontext *ctx ) -{ - SScontext *swsetup = (SScontext *)CALLOC(sizeof(SScontext)); - - if (!swsetup) - return GL_FALSE; - - ctx->swsetup_context = swsetup; - - swsetup->NewState = ~0; - _swsetup_trifuncs_init( ctx ); - - _tnl_init_vertices( ctx, ctx->Const.MaxArrayLockSize + 12, - sizeof(SWvertex) ); - - - return GL_TRUE; -} - -void -_swsetup_DestroyContext( GLcontext *ctx ) -{ - SScontext *swsetup = SWSETUP_CONTEXT(ctx); - - if (swsetup) { - FREE(swsetup); - ctx->swsetup_context = 0; - } - - _tnl_free_vertices( ctx ); -} - -static void -_swsetup_RenderPrimitive( GLcontext *ctx, GLenum mode ) -{ - SWSETUP_CONTEXT(ctx)->render_prim = mode; - _swrast_render_primitive( ctx, mode ); -} - -#define SWZ ((SWvertex *)0) -#define SWOffset(MEMBER) (((char *)&(SWZ->MEMBER)) - ((char *)SWZ)) - -#define EMIT_ATTR( ATTR, STYLE, MEMBER ) \ -do { \ - map[e].attrib = (ATTR); \ - map[e].format = (STYLE); \ - map[e].offset = SWOffset(MEMBER); \ - e++; \ -} while (0) - - -/* - * We patch this function into tnl->Driver.Render.Start. - * It's called when we start rendering a vertex buffer. - */ -static void -_swsetup_RenderStart( GLcontext *ctx ) -{ - SScontext *swsetup = SWSETUP_CONTEXT(ctx); - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - GLuint new_state = swsetup->NewState; - - if (new_state & _SWSETUP_NEW_RENDERINDEX) { - _swsetup_choose_trifuncs( ctx ); - } - - swsetup->NewState = 0; - - _swrast_render_start( ctx ); - - /* Important: - */ - VB->AttribPtr[VERT_ATTRIB_POS] = VB->NdcPtr; - - - if (tnl->render_inputs != swsetup->last_index) { - GLuint index = tnl->render_inputs; - struct tnl_attr_map map[_TNL_ATTRIB_MAX]; - int i, e = 0; - - EMIT_ATTR( _TNL_ATTRIB_POS, EMIT_4F_VIEWPORT, win ); - - if (index & _TNL_BIT_COLOR0) - EMIT_ATTR( _TNL_ATTRIB_COLOR0, EMIT_4CHAN_4F_RGBA, color ); - - if (index & _TNL_BIT_COLOR1) - EMIT_ATTR( _TNL_ATTRIB_COLOR1, EMIT_4CHAN_4F_RGBA, specular); - - if (index & _TNL_BIT_FOG) - EMIT_ATTR( _TNL_ATTRIB_FOG, EMIT_1F, fog); - - if (index & _TNL_BITS_TEX_ANY) { - for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) { - if (index & _TNL_BIT_TEX(i)) { - EMIT_ATTR( _TNL_ATTRIB_TEX0+i, EMIT_4F, texcoord[i] ); - } - } - } - - if (index & _TNL_BIT_INDEX) - EMIT_ATTR( _TNL_ATTRIB_INDEX, EMIT_1F, index ); - - if (index & _TNL_BIT_POINTSIZE) - EMIT_ATTR( _TNL_ATTRIB_POINTSIZE, EMIT_1F, pointSize ); - - _tnl_install_attrs( ctx, map, e, - ctx->Viewport._WindowMap.m, - sizeof(SWvertex) ); - - swsetup->last_index = index; - } - -} - -/* - * We patch this function into tnl->Driver.Render.Finish. - * It's called when we finish rendering a vertex buffer. - */ -static void -_swsetup_RenderFinish( GLcontext *ctx ) -{ - _swrast_render_finish( ctx ); -} - -void -_swsetup_InvalidateState( GLcontext *ctx, GLuint new_state ) -{ - SScontext *swsetup = SWSETUP_CONTEXT(ctx); - swsetup->NewState |= new_state; - _tnl_invalidate_vertex_state( ctx, new_state ); -} - - -void -_swsetup_Wakeup( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - SScontext *swsetup = SWSETUP_CONTEXT(ctx); - - tnl->Driver.Render.Start = _swsetup_RenderStart; - tnl->Driver.Render.Finish = _swsetup_RenderFinish; - tnl->Driver.Render.PrimitiveNotify = _swsetup_RenderPrimitive; - tnl->Driver.Render.Interp = _tnl_interp; - tnl->Driver.Render.CopyPV = _tnl_copy_pv; - tnl->Driver.Render.ClippedPolygon = _tnl_RenderClippedPolygon; /* new */ - tnl->Driver.Render.ClippedLine = _tnl_RenderClippedLine; /* new */ - /* points */ - /* line */ - /* triangle */ - /* quad */ - tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts; - tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts; - tnl->Driver.Render.ResetLineStipple = _swrast_ResetLineStipple; - tnl->Driver.Render.BuildVertices = _tnl_build_vertices; - tnl->Driver.Render.Multipass = 0; - - _tnl_invalidate_vertices( ctx, ~0 ); - _tnl_need_projected_coords( ctx, GL_TRUE ); - _swsetup_InvalidateState( ctx, ~0 ); - - swsetup->verts = (SWvertex *)tnl->clipspace.vertex_buf; - swsetup->last_index = 0; -} - - - - - -/* Populate a swrast SWvertex from an attrib-style vertex. - */ -void -_swsetup_Translate( GLcontext *ctx, const void *vertex, SWvertex *dest ) -{ - const GLfloat *m = ctx->Viewport._WindowMap.m; - GLfloat tmp[4]; - GLuint i; - - _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_POS, tmp ); - - dest->win[0] = m[0] * tmp[0] + m[12]; - dest->win[1] = m[5] * tmp[1] + m[13]; - dest->win[2] = m[10] * tmp[2] + m[14]; - dest->win[3] = tmp[3]; - - - for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) - _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_TEX0+i, dest->texcoord[i] ); - - _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR0, tmp ); - UNCLAMPED_FLOAT_TO_RGBA_CHAN( dest->color, tmp ); - - _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_COLOR1, tmp ); - UNCLAMPED_FLOAT_TO_RGBA_CHAN( dest->specular, tmp ); - - _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_FOG, tmp ); - dest->fog = tmp[0]; - - _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_INDEX, tmp ); - dest->index = (GLuint) tmp[0]; - - _tnl_get_attr( ctx, vertex, _TNL_ATTRIB_POINTSIZE, tmp ); - dest->pointSize = tmp[0]; -} - diff --git a/nx-X11/extras/Mesa/src/mesa/swrast_setup/ss_context.h b/nx-X11/extras/Mesa/src/mesa/swrast_setup/ss_context.h deleted file mode 100644 index 2c6e4faf3..000000000 --- a/nx-X11/extras/Mesa/src/mesa/swrast_setup/ss_context.h +++ /dev/null @@ -1,45 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 4.1 - * - * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * 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. - * - * Authors: - * Keith Whitwell - */ - -#ifndef SS_CONTEXT_H -#define SS_CONTEXT_H - -#include "mtypes.h" -#include "swrast/swrast.h" -#include "swrast_setup.h" - -typedef struct { - GLuint NewState; - GLenum render_prim; - GLuint last_index; - SWvertex *verts; -} SScontext; - -#define SWSETUP_CONTEXT(ctx) ((SScontext *)ctx->swsetup_context) - -#endif diff --git a/nx-X11/extras/Mesa/src/mesa/swrast_setup/ss_triangle.c b/nx-X11/extras/Mesa/src/mesa/swrast_setup/ss_triangle.c deleted file mode 100644 index d37bdf71c..000000000 --- a/nx-X11/extras/Mesa/src/mesa/swrast_setup/ss_triangle.c +++ /dev/null @@ -1,314 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.1 - * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * 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. - * - * Authors: - * Keith Whitwell - */ - -#include "glheader.h" -#include "colormac.h" -#include "macros.h" -#include "mtypes.h" - -#include "tnl/t_context.h" - -#include "ss_triangle.h" -#include "ss_context.h" - -#define SS_RGBA_BIT 0x1 -#define SS_OFFSET_BIT 0x2 -#define SS_TWOSIDE_BIT 0x4 -#define SS_UNFILLED_BIT 0x8 -#define SS_MAX_TRIFUNC 0x10 - -static tnl_triangle_func tri_tab[SS_MAX_TRIFUNC]; -static tnl_quad_func quad_tab[SS_MAX_TRIFUNC]; - - -static void _swsetup_render_line_tri( GLcontext *ctx, - GLuint e0, GLuint e1, GLuint e2, - GLuint facing ) -{ - SScontext *swsetup = SWSETUP_CONTEXT(ctx); - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - GLubyte *ef = VB->EdgeFlag; - SWvertex *verts = swsetup->verts; - SWvertex *v0 = &verts[e0]; - SWvertex *v1 = &verts[e1]; - SWvertex *v2 = &verts[e2]; - GLchan c[2][4]; - GLchan s[2][4]; - GLfloat i[2]; - - /* cull testing */ - if (ctx->Polygon.CullFlag) { - if (facing == 1 && ctx->Polygon.CullFaceMode != GL_FRONT) - return; - if (facing == 0 && ctx->Polygon.CullFaceMode != GL_BACK) - return; - } - - if (ctx->Light.ShadeModel == GL_FLAT) { - COPY_CHAN4(c[0], v0->color); - COPY_CHAN4(c[1], v1->color); - COPY_CHAN4(s[0], v0->specular); - COPY_CHAN4(s[1], v1->specular); - i[0] = v0->index; - i[1] = v1->index; - - COPY_CHAN4(v0->color, v2->color); - COPY_CHAN4(v1->color, v2->color); - COPY_CHAN4(v0->specular, v2->specular); - COPY_CHAN4(v1->specular, v2->specular); - v0->index = v2->index; - v1->index = v2->index; - } - - if (swsetup->render_prim == GL_POLYGON) { - if (ef[e2]) _swrast_Line( ctx, v2, v0 ); - if (ef[e0]) _swrast_Line( ctx, v0, v1 ); - if (ef[e1]) _swrast_Line( ctx, v1, v2 ); - } else { - if (ef[e0]) _swrast_Line( ctx, v0, v1 ); - if (ef[e1]) _swrast_Line( ctx, v1, v2 ); - if (ef[e2]) _swrast_Line( ctx, v2, v0 ); - } - - if (ctx->Light.ShadeModel == GL_FLAT) { - COPY_CHAN4(v0->color, c[0]); - COPY_CHAN4(v1->color, c[1]); - COPY_CHAN4(v0->specular, s[0]); - COPY_CHAN4(v1->specular, s[1]); - v0->index = i[0]; - v1->index = i[1]; - } -} - -static void _swsetup_render_point_tri( GLcontext *ctx, - GLuint e0, GLuint e1, GLuint e2, - GLuint facing ) -{ - SScontext *swsetup = SWSETUP_CONTEXT(ctx); - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - GLubyte *ef = VB->EdgeFlag; - SWvertex *verts = swsetup->verts; - SWvertex *v0 = &verts[e0]; - SWvertex *v1 = &verts[e1]; - SWvertex *v2 = &verts[e2]; - GLchan c[2][4]; - GLchan s[2][4]; - GLfloat i[2]; - - /* cull testing */ - if (ctx->Polygon.CullFlag) { - if (facing == 1 && ctx->Polygon.CullFaceMode != GL_FRONT) - return; - if (facing == 0 && ctx->Polygon.CullFaceMode != GL_BACK) - return; - } - - if (ctx->Light.ShadeModel == GL_FLAT) { - /* save colors/indexes for v0, v1 vertices */ - COPY_CHAN4(c[0], v0->color); - COPY_CHAN4(c[1], v1->color); - COPY_CHAN4(s[0], v0->specular); - COPY_CHAN4(s[1], v1->specular); - i[0] = v0->index; - i[1] = v1->index; - - /* copy v2 color/indexes to v0, v1 indexes */ - COPY_CHAN4(v0->color, v2->color); - COPY_CHAN4(v1->color, v2->color); - COPY_CHAN4(v0->specular, v2->specular); - COPY_CHAN4(v1->specular, v2->specular); - v0->index = v2->index; - v1->index = v2->index; - } - - if (ef[e0]) _swrast_Point( ctx, v0 ); - if (ef[e1]) _swrast_Point( ctx, v1 ); - if (ef[e2]) _swrast_Point( ctx, v2 ); - - if (ctx->Light.ShadeModel == GL_FLAT) { - /* restore v0, v1 colores/indexes */ - COPY_CHAN4(v0->color, c[0]); - COPY_CHAN4(v1->color, c[1]); - COPY_CHAN4(v0->specular, s[0]); - COPY_CHAN4(v1->specular, s[1]); - v0->index = i[0]; - v1->index = i[1]; - } - _swrast_flush(ctx); -} - -#define SS_COLOR(a,b) UNCLAMPED_FLOAT_TO_RGBA_CHAN(a,b) -#define SS_SPEC(a,b) UNCLAMPED_FLOAT_TO_RGB_CHAN(a,b) -#define SS_IND(a,b) (a = b) - -#define IND (0) -#define TAG(x) x -#include "ss_tritmp.h" - -#define IND (SS_OFFSET_BIT) -#define TAG(x) x##_offset -#include "ss_tritmp.h" - -#define IND (SS_TWOSIDE_BIT) -#define TAG(x) x##_twoside -#include "ss_tritmp.h" - -#define IND (SS_OFFSET_BIT|SS_TWOSIDE_BIT) -#define TAG(x) x##_offset_twoside -#include "ss_tritmp.h" - -#define IND (SS_UNFILLED_BIT) -#define TAG(x) x##_unfilled -#include "ss_tritmp.h" - -#define IND (SS_OFFSET_BIT|SS_UNFILLED_BIT) -#define TAG(x) x##_offset_unfilled -#include "ss_tritmp.h" - -#define IND (SS_TWOSIDE_BIT|SS_UNFILLED_BIT) -#define TAG(x) x##_twoside_unfilled -#include "ss_tritmp.h" - -#define IND (SS_OFFSET_BIT|SS_TWOSIDE_BIT|SS_UNFILLED_BIT) -#define TAG(x) x##_offset_twoside_unfilled -#include "ss_tritmp.h" - -#define IND (0|SS_RGBA_BIT) -#define TAG(x) x##_rgba -#include "ss_tritmp.h" - -#define IND (SS_OFFSET_BIT|SS_RGBA_BIT) -#define TAG(x) x##_offset_rgba -#include "ss_tritmp.h" - -#define IND (SS_TWOSIDE_BIT|SS_RGBA_BIT) -#define TAG(x) x##_twoside_rgba -#include "ss_tritmp.h" - -#define IND (SS_OFFSET_BIT|SS_TWOSIDE_BIT|SS_RGBA_BIT) -#define TAG(x) x##_offset_twoside_rgba -#include "ss_tritmp.h" - -#define IND (SS_UNFILLED_BIT|SS_RGBA_BIT) -#define TAG(x) x##_unfilled_rgba -#include "ss_tritmp.h" - -#define IND (SS_OFFSET_BIT|SS_UNFILLED_BIT|SS_RGBA_BIT) -#define TAG(x) x##_offset_unfilled_rgba -#include "ss_tritmp.h" - -#define IND (SS_TWOSIDE_BIT|SS_UNFILLED_BIT|SS_RGBA_BIT) -#define TAG(x) x##_twoside_unfilled_rgba -#include "ss_tritmp.h" - -#define IND (SS_OFFSET_BIT|SS_TWOSIDE_BIT|SS_UNFILLED_BIT|SS_RGBA_BIT) -#define TAG(x) x##_offset_twoside_unfilled_rgba -#include "ss_tritmp.h" - - -void _swsetup_trifuncs_init( GLcontext *ctx ) -{ - (void) ctx; - - init(); - init_offset(); - init_twoside(); - init_offset_twoside(); - init_unfilled(); - init_offset_unfilled(); - init_twoside_unfilled(); - init_offset_twoside_unfilled(); - - init_rgba(); - init_offset_rgba(); - init_twoside_rgba(); - init_offset_twoside_rgba(); - init_unfilled_rgba(); - init_offset_unfilled_rgba(); - init_twoside_unfilled_rgba(); - init_offset_twoside_unfilled_rgba(); -} - - -static void swsetup_points( GLcontext *ctx, GLuint first, GLuint last ) -{ - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - SWvertex *verts = SWSETUP_CONTEXT(ctx)->verts; - GLuint i; - - if (VB->Elts) { - for (i = first; i < last; i++) - if (VB->ClipMask[VB->Elts[i]] == 0) - _swrast_Point( ctx, &verts[VB->Elts[i]] ); - } - else { - for (i = first; i < last; i++) - if (VB->ClipMask[i] == 0) - _swrast_Point( ctx, &verts[i] ); - } -} - -static void swsetup_line( GLcontext *ctx, GLuint v0, GLuint v1 ) -{ - SWvertex *verts = SWSETUP_CONTEXT(ctx)->verts; - _swrast_Line( ctx, &verts[v0], &verts[v1] ); -} - - - -void _swsetup_choose_trifuncs( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint ind = 0; - - if (ctx->Polygon.OffsetPoint || - ctx->Polygon.OffsetLine || - ctx->Polygon.OffsetFill) - ind |= SS_OFFSET_BIT; - - if ((ctx->Light.Enabled && ctx->Light.Model.TwoSide) || - (ctx->VertexProgram._Enabled && ctx->VertexProgram.TwoSideEnabled)) - ind |= SS_TWOSIDE_BIT; - - /* We piggyback the two-sided stencil front/back determination on the - * unfilled triangle path. - */ - if (ctx->Polygon.FrontMode != GL_FILL || - ctx->Polygon.BackMode != GL_FILL || - (ctx->Stencil.Enabled && ctx->Stencil.TestTwoSide)) - ind |= SS_UNFILLED_BIT; - - if (ctx->Visual.rgbMode) - ind |= SS_RGBA_BIT; - - tnl->Driver.Render.Triangle = tri_tab[ind]; - tnl->Driver.Render.Quad = quad_tab[ind]; - tnl->Driver.Render.Line = swsetup_line; - tnl->Driver.Render.Points = swsetup_points; - - ctx->_Facing = 0; -} diff --git a/nx-X11/extras/Mesa/src/mesa/swrast_setup/ss_triangle.h b/nx-X11/extras/Mesa/src/mesa/swrast_setup/ss_triangle.h deleted file mode 100644 index 78833269e..000000000 --- a/nx-X11/extras/Mesa/src/mesa/swrast_setup/ss_triangle.h +++ /dev/null @@ -1,39 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * 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. - * - * Authors: - * Keith Whitwell - */ - -#ifndef SS_TRIANGLE_H -#define SS_TRIANGLE_H - -#include "mtypes.h" -#include "ss_context.h" - - -void _swsetup_trifuncs_init( GLcontext *ctx ); -void _swsetup_choose_trifuncs( GLcontext *ctx ); - -#endif diff --git a/nx-X11/extras/Mesa/src/mesa/swrast_setup/ss_tritmp.h b/nx-X11/extras/Mesa/src/mesa/swrast_setup/ss_tritmp.h deleted file mode 100644 index 61c9b2817..000000000 --- a/nx-X11/extras/Mesa/src/mesa/swrast_setup/ss_tritmp.h +++ /dev/null @@ -1,222 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.1 - * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * 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. - * - * Authors: - * Keith Whitwell - */ - - -static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) -{ - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - SWvertex *verts = SWSETUP_CONTEXT(ctx)->verts; - SWvertex *v[3]; - GLfloat z[3]; - GLfloat offset; - GLenum mode = GL_FILL; - GLuint facing = 0; - GLchan saved_color[3][4]; - GLchan saved_spec[3][4]; - GLfloat saved_index[3]; - - v[0] = &verts[e0]; - v[1] = &verts[e1]; - v[2] = &verts[e2]; - - - if (IND & (SS_TWOSIDE_BIT | SS_OFFSET_BIT | SS_UNFILLED_BIT)) - { - GLfloat ex = v[0]->win[0] - v[2]->win[0]; - GLfloat ey = v[0]->win[1] - v[2]->win[1]; - GLfloat fx = v[1]->win[0] - v[2]->win[0]; - GLfloat fy = v[1]->win[1] - v[2]->win[1]; - GLfloat cc = ex*fy - ey*fx; - - if (IND & (SS_TWOSIDE_BIT | SS_UNFILLED_BIT)) - { - facing = (cc < 0.0) ^ ctx->Polygon._FrontBit; - if (ctx->Stencil.TestTwoSide) - ctx->_Facing = facing; /* for 2-sided stencil test */ - - if (IND & SS_UNFILLED_BIT) - mode = facing ? ctx->Polygon.BackMode : ctx->Polygon.FrontMode; - - if (facing == 1) { - if (IND & SS_TWOSIDE_BIT) { - if (IND & SS_RGBA_BIT) { - GLfloat (*vbcolor)[4] = VB->ColorPtr[1]->data; - - COPY_CHAN4(saved_color[0], v[0]->color); - COPY_CHAN4(saved_color[1], v[1]->color); - COPY_CHAN4(saved_color[2], v[2]->color); - - if (VB->ColorPtr[1]->stride) { - SS_COLOR(v[0]->color, vbcolor[e0]); - SS_COLOR(v[1]->color, vbcolor[e1]); - SS_COLOR(v[2]->color, vbcolor[e2]); - } - else { - SS_COLOR(v[0]->color, vbcolor[0]); - SS_COLOR(v[1]->color, vbcolor[0]); - SS_COLOR(v[2]->color, vbcolor[0]); - } - - if (VB->SecondaryColorPtr[1]) { - GLfloat (*vbspec)[4] = VB->SecondaryColorPtr[1]->data; - - COPY_CHAN4(saved_spec[0], v[0]->specular); - COPY_CHAN4(saved_spec[1], v[1]->specular); - COPY_CHAN4(saved_spec[2], v[2]->specular); - - if (VB->SecondaryColorPtr[1]->stride) { - SS_SPEC(v[0]->specular, vbspec[e0]); - SS_SPEC(v[1]->specular, vbspec[e1]); - SS_SPEC(v[2]->specular, vbspec[e2]); - } - else { - SS_SPEC(v[0]->specular, vbspec[0]); - SS_SPEC(v[1]->specular, vbspec[0]); - SS_SPEC(v[2]->specular, vbspec[0]); - } - } - } else { - GLfloat *vbindex = (GLfloat *)VB->IndexPtr[1]->data; - saved_index[0] = v[0]->index; - saved_index[1] = v[1]->index; - saved_index[2] = v[2]->index; - - SS_IND(v[0]->index, (GLuint) vbindex[e0]); - SS_IND(v[1]->index, (GLuint) vbindex[e1]); - SS_IND(v[2]->index, (GLuint) vbindex[e2]); - } - } - } - } - - if (IND & SS_OFFSET_BIT) - { - offset = ctx->Polygon.OffsetUnits * ctx->DrawBuffer->_MRD; - z[0] = v[0]->win[2]; - z[1] = v[1]->win[2]; - z[2] = v[2]->win[2]; - if (cc * cc > 1e-16) { - const GLfloat ez = z[0] - z[2]; - const GLfloat fz = z[1] - z[2]; - const GLfloat oneOverArea = 1.0F / cc; - const GLfloat dzdx = FABSF((ey * fz - ez * fy) * oneOverArea); - const GLfloat dzdy = FABSF((ez * fx - ex * fz) * oneOverArea); - offset += MAX2(dzdx, dzdy) * ctx->Polygon.OffsetFactor; - /* Unfortunately, we need to clamp to prevent negative Zs below. - * Technically, we should do the clamping per-fragment. - */ - offset = MAX2(offset, -v[0]->win[2]); - offset = MAX2(offset, -v[1]->win[2]); - offset = MAX2(offset, -v[2]->win[2]); - } - } - } - - if (mode == GL_POINT) { - if ((IND & SS_OFFSET_BIT) && ctx->Polygon.OffsetPoint) { - v[0]->win[2] += offset; - v[1]->win[2] += offset; - v[2]->win[2] += offset; - } - _swsetup_render_point_tri( ctx, e0, e1, e2, facing ); - } else if (mode == GL_LINE) { - if ((IND & SS_OFFSET_BIT) && ctx->Polygon.OffsetLine) { - v[0]->win[2] += offset; - v[1]->win[2] += offset; - v[2]->win[2] += offset; - } - _swsetup_render_line_tri( ctx, e0, e1, e2, facing ); - } else { - if ((IND & SS_OFFSET_BIT) && ctx->Polygon.OffsetFill) { - v[0]->win[2] += offset; - v[1]->win[2] += offset; - v[2]->win[2] += offset; - } - _swrast_Triangle( ctx, v[0], v[1], v[2] ); - } - - if (IND & SS_OFFSET_BIT) { - v[0]->win[2] = z[0]; - v[1]->win[2] = z[1]; - v[2]->win[2] = z[2]; - } - - if (IND & SS_TWOSIDE_BIT) { - if (facing == 1) { - if (IND & SS_RGBA_BIT) { - COPY_CHAN4(v[0]->color, saved_color[0]); - COPY_CHAN4(v[1]->color, saved_color[1]); - COPY_CHAN4(v[2]->color, saved_color[2]); - if (VB->SecondaryColorPtr[1]) { - COPY_CHAN4(v[0]->specular, saved_spec[0]); - COPY_CHAN4(v[1]->specular, saved_spec[1]); - COPY_CHAN4(v[2]->specular, saved_spec[2]); - } - } else { - v[0]->index = saved_index[0]; - v[1]->index = saved_index[1]; - v[2]->index = saved_index[2]; - } - } - } -} - - - -/* Need to fixup edgeflags when decomposing to triangles: - */ -static void TAG(quadfunc)( GLcontext *ctx, GLuint v0, - GLuint v1, GLuint v2, GLuint v3 ) -{ - if (IND & SS_UNFILLED_BIT) { - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - GLubyte ef1 = VB->EdgeFlag[v1]; - GLubyte ef3 = VB->EdgeFlag[v3]; - VB->EdgeFlag[v1] = 0; - TAG(triangle)( ctx, v0, v1, v3 ); - VB->EdgeFlag[v1] = ef1; - VB->EdgeFlag[v3] = 0; - TAG(triangle)( ctx, v1, v2, v3 ); - VB->EdgeFlag[v3] = ef3; - } else { - TAG(triangle)( ctx, v0, v1, v3 ); - TAG(triangle)( ctx, v1, v2, v3 ); - } -} - - - - -static void TAG(init)( void ) -{ - tri_tab[IND] = TAG(triangle); - quad_tab[IND] = TAG(quadfunc); -} - - -#undef IND -#undef TAG diff --git a/nx-X11/extras/Mesa/src/mesa/swrast_setup/swrast_setup.h b/nx-X11/extras/Mesa/src/mesa/swrast_setup/swrast_setup.h deleted file mode 100644 index 5dcbe2675..000000000 --- a/nx-X11/extras/Mesa/src/mesa/swrast_setup/swrast_setup.h +++ /dev/null @@ -1,61 +0,0 @@ - -/* - * Mesa 3-D graphics library - * Version: 3.5 - * - * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * 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. - * - * Authors: - * Keith Whitwell - */ - -/* Public interface to the swrast_setup module. This module provides - * an implementation of the driver interface to t_vb_render.c, and uses - * the software rasterizer (swrast) to perform actual rasterization. - * - * The internals of the implementation are private, but can be hooked - * into tnl at any time (except between RenderStart/RenderEnd) by - * calling _swsetup_Wakeup(). - */ - -#ifndef SWRAST_SETUP_H -#define SWRAST_SETUP_H - -#include "swrast/swrast.h" - -extern GLboolean -_swsetup_CreateContext( GLcontext *ctx ); - -extern void -_swsetup_DestroyContext( GLcontext *ctx ); - -extern void -_swsetup_InvalidateState( GLcontext *ctx, GLuint new_state ); - -extern void -_swsetup_Wakeup( GLcontext *ctx ); - -/* Helper function to translate a hardware vertex (as understood by - * the tnl/t_vertex.c code) to a swrast vertex. - */ -extern void -_swsetup_Translate( GLcontext *ctx, const void *vertex, SWvertex *dest ); - -#endif -- cgit v1.2.3