18e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell/**************************************************************************
28e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell *
38e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
48e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * All Rights Reserved.
58e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell *
68e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * Permission is hereby granted, free of charge, to any person obtaining a
78e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * copy of this software and associated documentation files (the
88e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * "Software"), to deal in the Software without restriction, including
98e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * without limitation the rights to use, copy, modify, merge, publish,
108e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * distribute, sub license, and/or sell copies of the Software, and to
118e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * permit persons to whom the Software is furnished to do so, subject to
128e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * the following conditions:
138e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell *
148e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * The above copyright notice and this permission notice (including the
158e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * next paragraph) shall be included in all copies or substantial portions
168e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * of the Software.
178e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell *
188e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
198e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
208e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
218e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
228e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
238e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
248e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
258e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell *
268e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell **************************************************************************/
278e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell
288e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell/* Authors:  Keith Whitwell <keith@tungstengraphics.com>
298e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell */
30ebafc193fac22c4d1d8d4f1c5a129d5dbe1679a2Brian
31b865f84c8d94959bd91ec1ab49dd919ea8cc8b8dBrian#ifndef SP_QUAD_PIPE_H
32b865f84c8d94959bd91ec1ab49dd919ea8cc8b8dBrian#define SP_QUAD_PIPE_H
33ebafc193fac22c4d1d8d4f1c5a129d5dbe1679a2Brian
348e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell
356393cda6766b707ef01e925d378239a66d143ae0Keith Whitwellstruct softpipe_context;
368e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwellstruct quad_header;
378e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell
388e4a95a93d15a6707a29454cd47e10b08314cda2Keith Whitwell
39b865f84c8d94959bd91ec1ab49dd919ea8cc8b8dBrian/**
40b865f84c8d94959bd91ec1ab49dd919ea8cc8b8dBrian * Fragment processing is performed on 2x2 blocks of pixels called "quads".
41b865f84c8d94959bd91ec1ab49dd919ea8cc8b8dBrian * Quad processing is performed with a pipeline of stages represented by
42b865f84c8d94959bd91ec1ab49dd919ea8cc8b8dBrian * this type.
43b865f84c8d94959bd91ec1ab49dd919ea8cc8b8dBrian */
44fb5cdbd078d4d44fb43d417843debe41148f3714Brianstruct quad_stage {
45fb5cdbd078d4d44fb43d417843debe41148f3714Brian   struct softpipe_context *softpipe;
46fb5cdbd078d4d44fb43d417843debe41148f3714Brian
47fb5cdbd078d4d44fb43d417843debe41148f3714Brian   struct quad_stage *next;
48fb5cdbd078d4d44fb43d417843debe41148f3714Brian
49f00179f9b47e17087d546940e1d57ffb2e2a8e42Brian   void (*begin)(struct quad_stage *qs);
50f00179f9b47e17087d546940e1d57ffb2e2a8e42Brian
51fb5cdbd078d4d44fb43d417843debe41148f3714Brian   /** the stage action */
52ab9fb5167023a26566b53e98f206dd73a18000f3Keith Whitwell   void (*run)(struct quad_stage *qs, struct quad_header *quad[], unsigned nr);
536961769cb23c8b9ed2fb56d8ce6e649848412357michal
546961769cb23c8b9ed2fb56d8ce6e649848412357michal   void (*destroy)(struct quad_stage *qs);
55fb5cdbd078d4d44fb43d417843debe41148f3714Brian};
56fb5cdbd078d4d44fb43d417843debe41148f3714Brian
57fb5cdbd078d4d44fb43d417843debe41148f3714Brian
58e89bd0fbc56ecfb96f3aff926c5891c45221dd37Brianstruct quad_stage *sp_quad_polygon_stipple_stage( struct softpipe_context *softpipe );
597f718f047676e88b660618784f256a96f7e8ed58Michal Krolstruct quad_stage *sp_quad_earlyz_stage( struct softpipe_context *softpipe );
60fb5cdbd078d4d44fb43d417843debe41148f3714Brianstruct quad_stage *sp_quad_shade_stage( struct softpipe_context *softpipe );
61493ed9fc11a2bf272a2c1e9e5a072e4f02b46554Brianstruct quad_stage *sp_quad_alpha_test_stage( struct softpipe_context *softpipe );
62e6eca5c37e13fd0f9100de127075b1bbed0821c0Brianstruct quad_stage *sp_quad_stencil_test_stage( struct softpipe_context *softpipe );
63fb5cdbd078d4d44fb43d417843debe41148f3714Brianstruct quad_stage *sp_quad_depth_test_stage( struct softpipe_context *softpipe );
64563479552e2f491fb94e7fac5772f3c72cee962aBrianstruct quad_stage *sp_quad_occlusion_stage( struct softpipe_context *softpipe );
6546bba80a54afbcabc0f064433cc2194473661c30Brianstruct quad_stage *sp_quad_coverage_stage( struct softpipe_context *softpipe );
66fb5cdbd078d4d44fb43d417843debe41148f3714Brianstruct quad_stage *sp_quad_blend_stage( struct softpipe_context *softpipe );
6786352ff70d8c9a31fe0ebb4d02ce4bb4644fe54aBrianstruct quad_stage *sp_quad_colormask_stage( struct softpipe_context *softpipe );
68fb5cdbd078d4d44fb43d417843debe41148f3714Brianstruct quad_stage *sp_quad_output_stage( struct softpipe_context *softpipe );
69fb5cdbd078d4d44fb43d417843debe41148f3714Brian
70ebafc193fac22c4d1d8d4f1c5a129d5dbe1679a2Brianvoid sp_build_quad_pipeline(struct softpipe_context *sp);
71ebafc193fac22c4d1d8d4f1c5a129d5dbe1679a2Brian
72b865f84c8d94959bd91ec1ab49dd919ea8cc8b8dBrian#endif /* SP_QUAD_PIPE_H */
73