1a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell/************************************************************************** 2a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell * 3a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. 4a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell * All Rights Reserved. 5a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell * 6a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell * Permission is hereby granted, free of charge, to any person obtaining a 7a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell * copy of this software and associated documentation files (the 8a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell * "Software"), to deal in the Software without restriction, including 9a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell * without limitation the rights to use, copy, modify, merge, publish, 10a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell * distribute, sub license, and/or sell copies of the Software, and to 11a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell * permit persons to whom the Software is furnished to do so, subject to 12a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell * the following conditions: 13a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell * 14a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell * The above copyright notice and this permission notice (including the 15a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell * next paragraph) shall be included in all copies or substantial portions 16a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell * of the Software. 17a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell * 18a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. 21a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR 22a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell * 26a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell **************************************************************************/ 27a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell 284f25420bdd834e81a3e22733304efc5261c2998aBrian Paul#include "util/u_memory.h" 296c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell#include "util/u_math.h" 30a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell#include "pipe/p_context.h" 31a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell#include "draw/draw_context.h" 32a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell#include "draw/draw_private.h" 33a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell#include "draw/draw_pt.h" 341865f341d8f45b389061fc08d2da90b7aa8a6099Dave Airlie#include "draw/draw_vs.h" 356c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell 366c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell#define DO_CLIP_XY 0x1 376c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell#define DO_CLIP_FULL_Z 0x2 386c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell#define DO_CLIP_HALF_Z 0x4 396c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell#define DO_CLIP_USER 0x8 406c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell#define DO_VIEWPORT 0x10 416c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell#define DO_EDGEFLAG 0x20 424465efc3bf8d755a9afb7a4bb5382e2f5bf113e1Brian Paul#define DO_CLIP_XY_GUARD_BAND 0x40 436c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell 446c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell 45a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwellstruct pt_post_vs { 46a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell struct draw_context *draw; 47a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell 486c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell unsigned flags; 496c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell 50a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell boolean (*run)( struct pt_post_vs *pvs, 51a192b5eeafae80f9f9e7e7e442abc5b44d583d1aZack Rusin struct draw_vertex_info *info ); 52a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell}; 53a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell 545cf1921e6d7ba36e6e882094d3280e3cd363df61Zack Rusinstatic INLINE void 555cf1921e6d7ba36e6e882094d3280e3cd363df61Zack Rusininitialize_vertex_header(struct vertex_header *header) 565cf1921e6d7ba36e6e882094d3280e3cd363df61Zack Rusin{ 575cf1921e6d7ba36e6e882094d3280e3cd363df61Zack Rusin header->clipmask = 0; 585cf1921e6d7ba36e6e882094d3280e3cd363df61Zack Rusin header->edgeflag = 1; 591865f341d8f45b389061fc08d2da90b7aa8a6099Dave Airlie header->have_clipdist = 0; 605cf1921e6d7ba36e6e882094d3280e3cd363df61Zack Rusin header->vertex_id = UNDEFINED_VERTEX_ID; 615cf1921e6d7ba36e6e882094d3280e3cd363df61Zack Rusin} 62a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell 63507fbe2d327efb8d608ce8e07436b97321560808Keith Whitwellstatic INLINE float 64507fbe2d327efb8d608ce8e07436b97321560808Keith Whitwelldot4(const float *a, const float *b) 65507fbe2d327efb8d608ce8e07436b97321560808Keith Whitwell{ 66507fbe2d327efb8d608ce8e07436b97321560808Keith Whitwell return (a[0]*b[0] + 67507fbe2d327efb8d608ce8e07436b97321560808Keith Whitwell a[1]*b[1] + 68507fbe2d327efb8d608ce8e07436b97321560808Keith Whitwell a[2]*b[2] + 69507fbe2d327efb8d608ce8e07436b97321560808Keith Whitwell a[3]*b[3]); 70507fbe2d327efb8d608ce8e07436b97321560808Keith Whitwell} 71507fbe2d327efb8d608ce8e07436b97321560808Keith Whitwell 726c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell#define FLAGS (0) 736c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell#define TAG(x) x##_none 746c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell#include "draw_cliptest_tmp.h" 75a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell 766c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell#define FLAGS (DO_CLIP_XY | DO_CLIP_FULL_Z | DO_VIEWPORT) 776c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell#define TAG(x) x##_xy_fullz_viewport 786c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell#include "draw_cliptest_tmp.h" 795d873c87186fd3a59b46b4e1e0c987120aa961a7Brian Paul 806c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell#define FLAGS (DO_CLIP_XY | DO_CLIP_HALF_Z | DO_VIEWPORT) 816c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell#define TAG(x) x##_xy_halfz_viewport 826c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell#include "draw_cliptest_tmp.h" 83a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell 844465efc3bf8d755a9afb7a4bb5382e2f5bf113e1Brian Paul#define FLAGS (DO_CLIP_XY_GUARD_BAND | DO_CLIP_HALF_Z | DO_VIEWPORT) 854465efc3bf8d755a9afb7a4bb5382e2f5bf113e1Brian Paul#define TAG(x) x##_xy_gb_halfz_viewport 864465efc3bf8d755a9afb7a4bb5382e2f5bf113e1Brian Paul#include "draw_cliptest_tmp.h" 874465efc3bf8d755a9afb7a4bb5382e2f5bf113e1Brian Paul 886c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell#define FLAGS (DO_CLIP_FULL_Z | DO_VIEWPORT) 896c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell#define TAG(x) x##_fullz_viewport 906c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell#include "draw_cliptest_tmp.h" 91a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell 926c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell#define FLAGS (DO_CLIP_HALF_Z | DO_VIEWPORT) 936c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell#define TAG(x) x##_halfz_viewport 946c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell#include "draw_cliptest_tmp.h" 95a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell 966c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell#define FLAGS (DO_CLIP_XY | DO_CLIP_FULL_Z | DO_CLIP_USER | DO_VIEWPORT) 976c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell#define TAG(x) x##_xy_fullz_user_viewport 986c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell#include "draw_cliptest_tmp.h" 99a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell 1006c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell#define FLAGS (DO_CLIP_XY | DO_CLIP_FULL_Z | DO_CLIP_USER | DO_VIEWPORT | DO_EDGEFLAG) 1016c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell#define TAG(x) x##_xy_fullz_user_viewport_edgeflag 1026c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell#include "draw_cliptest_tmp.h" 103a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell 104a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell 105a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell 1066c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell/* Don't want to create 64 versions of this function, so catch the 1076c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell * less common ones here. This is looking like something which should 1086c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell * be code-generated, perhaps appended to the end of the vertex 1096c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell * shader. 110a08e348a84f57ed5e8bf5888f1ce13934d2ce8faKeith Whitwell */ 1116c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell#define FLAGS (pvs->flags) 1126c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell#define TAG(x) x##_generic 1136c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell#include "draw_cliptest_tmp.h" 114a08e348a84f57ed5e8bf5888f1ce13934d2ce8faKeith Whitwell 115a08e348a84f57ed5e8bf5888f1ce13934d2ce8faKeith Whitwell 116a08e348a84f57ed5e8bf5888f1ce13934d2ce8faKeith Whitwell 117a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwellboolean draw_pt_post_vs_run( struct pt_post_vs *pvs, 118a192b5eeafae80f9f9e7e7e442abc5b44d583d1aZack Rusin struct draw_vertex_info *info ) 119a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell{ 120a192b5eeafae80f9f9e7e7e442abc5b44d583d1aZack Rusin return pvs->run( pvs, info ); 121a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell} 122a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell 123a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell 124a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwellvoid draw_pt_post_vs_prepare( struct pt_post_vs *pvs, 1256c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell boolean clip_xy, 1266c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell boolean clip_z, 1276c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell boolean clip_user, 1284465efc3bf8d755a9afb7a4bb5382e2f5bf113e1Brian Paul boolean guard_band, 129683e7091a953204c9aee1410ac44be3b69bae9fcKeith Whitwell boolean bypass_viewport, 130a0127b6ced257919180ba3a1bf534b68d9c750beRoland Scheidegger boolean opengl, 131a0127b6ced257919180ba3a1bf534b68d9c750beRoland Scheidegger boolean need_edgeflags ) 132a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell{ 1336c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell pvs->flags = 0; 1346c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell 1354465efc3bf8d755a9afb7a4bb5382e2f5bf113e1Brian Paul /* This combination not currently tested/in use: 1364465efc3bf8d755a9afb7a4bb5382e2f5bf113e1Brian Paul */ 1374465efc3bf8d755a9afb7a4bb5382e2f5bf113e1Brian Paul if (opengl) 1384465efc3bf8d755a9afb7a4bb5382e2f5bf113e1Brian Paul guard_band = FALSE; 1394465efc3bf8d755a9afb7a4bb5382e2f5bf113e1Brian Paul 1404465efc3bf8d755a9afb7a4bb5382e2f5bf113e1Brian Paul if (clip_xy && !guard_band) { 1416c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell pvs->flags |= DO_CLIP_XY; 1424465efc3bf8d755a9afb7a4bb5382e2f5bf113e1Brian Paul ASSIGN_4V( pvs->draw->plane[0], -1, 0, 0, 1 ); 1434465efc3bf8d755a9afb7a4bb5382e2f5bf113e1Brian Paul ASSIGN_4V( pvs->draw->plane[1], 1, 0, 0, 1 ); 1444465efc3bf8d755a9afb7a4bb5382e2f5bf113e1Brian Paul ASSIGN_4V( pvs->draw->plane[2], 0, -1, 0, 1 ); 1454465efc3bf8d755a9afb7a4bb5382e2f5bf113e1Brian Paul ASSIGN_4V( pvs->draw->plane[3], 0, 1, 0, 1 ); 1464465efc3bf8d755a9afb7a4bb5382e2f5bf113e1Brian Paul } 1474465efc3bf8d755a9afb7a4bb5382e2f5bf113e1Brian Paul else if (clip_xy && guard_band) { 1484465efc3bf8d755a9afb7a4bb5382e2f5bf113e1Brian Paul pvs->flags |= DO_CLIP_XY_GUARD_BAND; 1494465efc3bf8d755a9afb7a4bb5382e2f5bf113e1Brian Paul ASSIGN_4V( pvs->draw->plane[0], -0.5, 0, 0, 1 ); 1504465efc3bf8d755a9afb7a4bb5382e2f5bf113e1Brian Paul ASSIGN_4V( pvs->draw->plane[1], 0.5, 0, 0, 1 ); 1514465efc3bf8d755a9afb7a4bb5382e2f5bf113e1Brian Paul ASSIGN_4V( pvs->draw->plane[2], 0, -0.5, 0, 1 ); 1524465efc3bf8d755a9afb7a4bb5382e2f5bf113e1Brian Paul ASSIGN_4V( pvs->draw->plane[3], 0, 0.5, 0, 1 ); 1534465efc3bf8d755a9afb7a4bb5382e2f5bf113e1Brian Paul } 1544465efc3bf8d755a9afb7a4bb5382e2f5bf113e1Brian Paul 1556c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell if (clip_z && opengl) { 1566c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell pvs->flags |= DO_CLIP_FULL_Z; 1576c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell ASSIGN_4V( pvs->draw->plane[4], 0, 0, 1, 1 ); 1586c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell } 1596c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell 1606c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell if (clip_z && !opengl) { 1616c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell pvs->flags |= DO_CLIP_HALF_Z; 1626c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell ASSIGN_4V( pvs->draw->plane[4], 0, 0, 1, 0 ); 163a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell } 1646c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell 1656c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell if (clip_user) 1666c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell pvs->flags |= DO_CLIP_USER; 1676c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell 1686c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell if (!bypass_viewport) 1696c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell pvs->flags |= DO_VIEWPORT; 1706c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell 1716c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell if (need_edgeflags) 1726c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell pvs->flags |= DO_EDGEFLAG; 1736c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell 1746c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell /* Now select the relevant function: 1756c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell */ 1766c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell switch (pvs->flags) { 1776c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell case 0: 1786c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell pvs->run = do_cliptest_none; 1796c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell break; 1806c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell 1816c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell case DO_CLIP_XY | DO_CLIP_FULL_Z | DO_VIEWPORT: 1826c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell pvs->run = do_cliptest_xy_fullz_viewport; 1836c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell break; 1846c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell 1856c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell case DO_CLIP_XY | DO_CLIP_HALF_Z | DO_VIEWPORT: 1866c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell pvs->run = do_cliptest_xy_halfz_viewport; 1876c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell break; 1886c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell 1894465efc3bf8d755a9afb7a4bb5382e2f5bf113e1Brian Paul case DO_CLIP_XY_GUARD_BAND | DO_CLIP_HALF_Z | DO_VIEWPORT: 1904465efc3bf8d755a9afb7a4bb5382e2f5bf113e1Brian Paul pvs->run = do_cliptest_xy_gb_halfz_viewport; 1914465efc3bf8d755a9afb7a4bb5382e2f5bf113e1Brian Paul break; 1924465efc3bf8d755a9afb7a4bb5382e2f5bf113e1Brian Paul 1936c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell case DO_CLIP_FULL_Z | DO_VIEWPORT: 1946c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell pvs->run = do_cliptest_fullz_viewport; 1956c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell break; 1966c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell 1976c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell case DO_CLIP_HALF_Z | DO_VIEWPORT: 1986c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell pvs->run = do_cliptest_halfz_viewport; 1996c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell break; 2006c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell 2016c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell case DO_CLIP_XY | DO_CLIP_FULL_Z | DO_CLIP_USER | DO_VIEWPORT: 2026c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell pvs->run = do_cliptest_xy_fullz_user_viewport; 2036c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell break; 2046c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell 2056c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell case (DO_CLIP_XY | DO_CLIP_FULL_Z | DO_CLIP_USER | 2066c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell DO_VIEWPORT | DO_EDGEFLAG): 2076c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell pvs->run = do_cliptest_xy_fullz_user_viewport_edgeflag; 2086c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell break; 2096c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell 2106c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell default: 2116c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell pvs->run = do_cliptest_generic; 2126c0dc4bafbdbdc0cb4b6e5934fe064226dbd47ecKeith Whitwell break; 213a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell } 214a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell} 215a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell 216a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell 217a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwellstruct pt_post_vs *draw_pt_post_vs_create( struct draw_context *draw ) 218a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell{ 219a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell struct pt_post_vs *pvs = CALLOC_STRUCT( pt_post_vs ); 220a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell if (!pvs) 221a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell return NULL; 222a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell 223a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell pvs->draw = draw; 224a192b5eeafae80f9f9e7e7e442abc5b44d583d1aZack Rusin 225a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell return pvs; 226a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell} 227a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell 228a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwellvoid draw_pt_post_vs_destroy( struct pt_post_vs *pvs ) 229a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell{ 230a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell FREE(pvs); 231a773f06e969a3992451dd7fe6fd55ea96b2774faKeith Whitwell} 232