X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Ftnl%2Ft_vertex.c;h=b3deac02491b6081e55f94a31b5793a1c3eaeba5;hb=bd69f65f90ecfa45e43a72504d277cb39f00e1c1;hp=a42f46053fdec348b85a5484701f2016ec4eef4a;hpb=c9bb052e31b7952272e60d28969e90eafb6b3e1f;p=mesa.git diff --git a/src/mesa/tnl/t_vertex.c b/src/mesa/tnl/t_vertex.c index a42f46053fd..b3deac02491 100644 --- a/src/mesa/tnl/t_vertex.c +++ b/src/mesa/tnl/t_vertex.c @@ -1,5 +1,5 @@ /* - * Copyright 2003 Tungsten Graphics, inc. + * Copyright 2003 VMware, Inc. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -16,13 +16,13 @@ * 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 NON-INFRINGEMENT. IN NO EVENT SHALL - * TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * VMWARE AND/OR THEIR SUPPLIERS 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 + * Keith Whitwell */ #include "main/glheader.h" @@ -158,9 +158,9 @@ static void choose_interp_func( struct gl_context *ctx, struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); GLboolean unfilled = (ctx->Polygon.FrontMode != GL_FILL || ctx->Polygon.BackMode != GL_FILL); - if (vtx->need_extras && - ((ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE) || - unfilled))) { + GLboolean twosided = ctx->Light.Enabled && ctx->Light.Model.TwoSide; + + if (vtx->need_extras && (twosided || unfilled)) { vtx->interp = _tnl_generic_interp_extras; } else { vtx->interp = _tnl_generic_interp; @@ -176,9 +176,9 @@ static void choose_copy_pv_func( struct gl_context *ctx, GLuint edst, GLuint es GLboolean unfilled = (ctx->Polygon.FrontMode != GL_FILL || ctx->Polygon.BackMode != GL_FILL); - if (vtx->need_extras && - ((ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE) || - unfilled))) { + GLboolean twosided = ctx->Light.Enabled && ctx->Light.Model.TwoSide; + + if (vtx->need_extras && (twosided || unfilled)) { vtx->copy_pv = _tnl_generic_copy_pv_extras; } else { vtx->copy_pv = _tnl_generic_copy_pv; @@ -546,10 +546,8 @@ void _tnl_free_vertices( struct gl_context *ctx ) struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); struct tnl_clipspace_fastpath *fp, *tmp; - if (vtx->vertex_buf) { - _mesa_align_free(vtx->vertex_buf); - vtx->vertex_buf = NULL; - } + _mesa_align_free(vtx->vertex_buf); + vtx->vertex_buf = NULL; for (fp = vtx->fastpath ; fp ; fp = tmp) { tmp = fp->next;