Path: blob/21.2-virgl/src/gallium/drivers/softpipe/sp_setup.h
4570 views
/**************************************************************************1*2* Copyright 2007 VMware, Inc.3* All Rights Reserved.4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the7* "Software"), to deal in the Software without restriction, including8* without limitation the rights to use, copy, modify, merge, publish,9* distribute, sub license, and/or sell copies of the Software, and to10* permit persons to whom the Software is furnished to do so, subject to11* the following conditions:12*13* The above copyright notice and this permission notice (including the14* next paragraph) shall be included in all copies or substantial portions15* of the Software.16*17* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS18* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF19* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.20* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR21* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,22* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE23* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.24*25**************************************************************************/26#ifndef SP_SETUP_H27#define SP_SETUP_H2829struct setup_context;30struct softpipe_context;3132/**33* Attribute interpolation mode34*/35enum sp_interp_mode {36SP_INTERP_POS, /**< special case for frag position */37SP_INTERP_CONSTANT,38SP_INTERP_LINEAR,39SP_INTERP_PERSPECTIVE40};414243struct sp_setup_info {44unsigned valid;45struct {46unsigned interp:8; /**< SP_INTERP_X */47int src_index:8;48} attrib[PIPE_MAX_SHADER_OUTPUTS];49};5051void52sp_setup_tri(struct setup_context *setup,53const float (*v0)[4],54const float (*v1)[4],55const float (*v2)[4]);5657void58sp_setup_line(struct setup_context *setup,59const float (*v0)[4],60const float (*v1)[4]);6162void63sp_setup_point( struct setup_context *setup,64const float (*v0)[4] );6566static inline unsigned67sp_clamp_viewport_idx(int idx)68{69return (PIPE_MAX_VIEWPORTS > idx && idx >= 0) ? idx : 0;70}7172struct setup_context *sp_setup_create_context( struct softpipe_context *softpipe );73void sp_setup_prepare( struct setup_context *setup );74void sp_setup_destroy_context( struct setup_context *setup );7576#endif777879