14a49301eSmrg/************************************************************************** 24a49301eSmrg * 3af69d88dSmrg * Copyright 2007 VMware, Inc. 44a49301eSmrg * All Rights Reserved. 54a49301eSmrg * 64a49301eSmrg * Permission is hereby granted, free of charge, to any person obtaining a 74a49301eSmrg * copy of this software and associated documentation files (the 84a49301eSmrg * "Software"), to deal in the Software without restriction, including 94a49301eSmrg * without limitation the rights to use, copy, modify, merge, publish, 104a49301eSmrg * distribute, sub license, and/or sell copies of the Software, and to 114a49301eSmrg * permit persons to whom the Software is furnished to do so, subject to 124a49301eSmrg * the following conditions: 134a49301eSmrg * 144a49301eSmrg * The above copyright notice and this permission notice (including the 154a49301eSmrg * next paragraph) shall be included in all copies or substantial portions 164a49301eSmrg * of the Software. 174a49301eSmrg * 184a49301eSmrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 194a49301eSmrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 204a49301eSmrg * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. 21af69d88dSmrg * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR 224a49301eSmrg * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 234a49301eSmrg * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 244a49301eSmrg * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 254a49301eSmrg * 264a49301eSmrg **************************************************************************/ 274a49301eSmrg#ifndef SP_SETUP_H 284a49301eSmrg#define SP_SETUP_H 294a49301eSmrg 304a49301eSmrgstruct setup_context; 314a49301eSmrgstruct softpipe_context; 324a49301eSmrg 3301e04c3fSmrg/** 3401e04c3fSmrg * Attribute interpolation mode 3501e04c3fSmrg */ 3601e04c3fSmrgenum sp_interp_mode { 3701e04c3fSmrg SP_INTERP_POS, /**< special case for frag position */ 3801e04c3fSmrg SP_INTERP_CONSTANT, 3901e04c3fSmrg SP_INTERP_LINEAR, 4001e04c3fSmrg SP_INTERP_PERSPECTIVE 4101e04c3fSmrg}; 4201e04c3fSmrg 4301e04c3fSmrg 4401e04c3fSmrgstruct sp_setup_info { 4501e04c3fSmrg unsigned valid; 4601e04c3fSmrg struct { 4701e04c3fSmrg unsigned interp:8; /**< SP_INTERP_X */ 4801e04c3fSmrg int src_index:8; 4901e04c3fSmrg } attrib[PIPE_MAX_SHADER_OUTPUTS]; 5001e04c3fSmrg}; 5101e04c3fSmrg 524a49301eSmrgvoid 5301e04c3fSmrgsp_setup_tri(struct setup_context *setup, 5401e04c3fSmrg const float (*v0)[4], 5501e04c3fSmrg const float (*v1)[4], 5601e04c3fSmrg const float (*v2)[4]); 574a49301eSmrg 584a49301eSmrgvoid 594a49301eSmrgsp_setup_line(struct setup_context *setup, 604a49301eSmrg const float (*v0)[4], 614a49301eSmrg const float (*v1)[4]); 624a49301eSmrg 634a49301eSmrgvoid 644a49301eSmrgsp_setup_point( struct setup_context *setup, 654a49301eSmrg const float (*v0)[4] ); 664a49301eSmrg 6701e04c3fSmrgstatic inline unsigned 6801e04c3fSmrgsp_clamp_viewport_idx(int idx) 6901e04c3fSmrg{ 7001e04c3fSmrg return (PIPE_MAX_VIEWPORTS > idx && idx >= 0) ? idx : 0; 7101e04c3fSmrg} 724a49301eSmrg 734a49301eSmrgstruct setup_context *sp_setup_create_context( struct softpipe_context *softpipe ); 744a49301eSmrgvoid sp_setup_prepare( struct setup_context *setup ); 754a49301eSmrgvoid sp_setup_destroy_context( struct setup_context *setup ); 764a49301eSmrg 774a49301eSmrg#endif 78