Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygens_span.h
Go to the documentation of this file.
00001 /* 00002 * Mesa 3-D graphics library 00003 * Version: 6.5 00004 * 00005 * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. 00006 * 00007 * Permission is hereby granted, free of charge, to any person obtaining a 00008 * copy of this software and associated documentation files (the "Software"), 00009 * to deal in the Software without restriction, including without limitation 00010 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 00011 * and/or sell copies of the Software, and to permit persons to whom the 00012 * Software is furnished to do so, subject to the following conditions: 00013 * 00014 * The above copyright notice and this permission notice shall be included 00015 * in all copies or substantial portions of the Software. 00016 * 00017 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00018 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00019 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 00020 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 00021 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 00022 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00023 */ 00024 00025 00026 #ifndef S_SPAN_H 00027 #define S_SPAN_H 00028 00029 00030 #include "swrast.h" 00031 00032 00042 #define SPAN_RGBA 0x01 00043 #define SPAN_INDEX 0x02 00044 #define SPAN_Z 0x04 00045 #define SPAN_FLAT 0x08 00046 #define SPAN_XY 0x10 00047 #define SPAN_MASK 0x20 00048 #define SPAN_LAMBDA 0x40 00049 #define SPAN_COVERAGE 0x80 00051 00052 00061 typedef struct sw_span_arrays 00062 { 00064 /* XXX someday look at transposing first two indexes for better memory 00065 * access pattern. 00066 */ 00067 GLfloat attribs[FRAG_ATTRIB_MAX][MAX_WIDTH][4]; 00068 00070 GLubyte mask[MAX_WIDTH]; 00071 00072 GLenum ChanType; 00076 GLubyte rgba8[MAX_WIDTH][4]; 00077 GLushort rgba16[MAX_WIDTH][4]; 00078 GLchan (*rgba)[4]; 00079 GLint x[MAX_WIDTH]; 00080 GLint y[MAX_WIDTH]; 00081 GLuint z[MAX_WIDTH]; 00082 GLuint index[MAX_WIDTH]; 00083 GLfloat lambda[MAX_TEXTURE_COORD_UNITS][MAX_WIDTH]; 00084 GLfloat coverage[MAX_WIDTH]; 00086 } SWspanarrays; 00087 00088 00101 typedef struct sw_span 00102 { 00104 GLint x, y; 00105 00107 GLuint end; 00108 00110 GLboolean writeAll; 00111 00113 GLenum primitive; 00114 00116 GLuint facing; 00117 00122 GLbitfield interpMask; 00123 00125 GLfloat attrStart[FRAG_ATTRIB_MAX][4]; 00126 GLfloat attrStepX[FRAG_ATTRIB_MAX][4]; 00127 GLfloat attrStepY[FRAG_ATTRIB_MAX][4]; 00129 /* XXX the rest of these will go away eventually... */ 00130 00131 /* For horizontal spans, step is the partial derivative wrt X. 00132 * For lines, step is the delta from one fragment to the next. 00133 */ 00134 GLfixed red, redStep; 00135 GLfixed green, greenStep; 00136 GLfixed blue, blueStep; 00137 GLfixed alpha, alphaStep; 00138 GLfixed index, indexStep; 00139 GLfixed z, zStep; 00140 GLfixed intTex[2], intTexStep[2]; 00146 GLbitfield arrayMask; 00147 00148 GLbitfield arrayAttribs; 00149 00156 SWspanarrays *array; 00157 } SWspan; 00158 00159 00160 00161 #define INIT_SPAN(S, PRIMITIVE) \ 00162 do { \ 00163 (S).primitive = (PRIMITIVE); \ 00164 (S).interpMask = 0x0; \ 00165 (S).arrayMask = 0x0; \ 00166 (S).arrayAttribs = 0x0; \ 00167 (S).end = 0; \ 00168 (S).facing = 0; \ 00169 (S).array = SWRAST_CONTEXT(ctx)->SpanArrays; \ 00170 } while (0) 00171 00172 00173 00174 extern void 00175 _swrast_span_default_attribs(GLcontext *ctx, SWspan *span); 00176 00177 extern void 00178 _swrast_span_interpolate_z( const GLcontext *ctx, SWspan *span ); 00179 00180 extern GLfloat 00181 _swrast_compute_lambda(GLfloat dsdx, GLfloat dsdy, GLfloat dtdx, GLfloat dtdy, 00182 GLfloat dqdx, GLfloat dqdy, GLfloat texW, GLfloat texH, 00183 GLfloat s, GLfloat t, GLfloat q, GLfloat invQ); 00184 00185 extern void 00186 _swrast_write_index_span( GLcontext *ctx, SWspan *span); 00187 00188 00189 extern void 00190 _swrast_write_rgba_span( GLcontext *ctx, SWspan *span); 00191 00192 00193 extern void 00194 _swrast_read_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb, 00195 GLuint n, GLint x, GLint y, GLenum type, GLvoid *rgba); 00196 00197 extern void 00198 _swrast_read_index_span( GLcontext *ctx, struct gl_renderbuffer *rb, 00199 GLuint n, GLint x, GLint y, GLuint indx[] ); 00200 00201 extern void 00202 _swrast_get_values(GLcontext *ctx, struct gl_renderbuffer *rb, 00203 GLuint count, const GLint x[], const GLint y[], 00204 void *values, GLuint valueSize); 00205 00206 extern void 00207 _swrast_put_row(GLcontext *ctx, struct gl_renderbuffer *rb, 00208 GLuint count, GLint x, GLint y, 00209 const GLvoid *values, GLuint valueSize); 00210 00211 extern void 00212 _swrast_get_row(GLcontext *ctx, struct gl_renderbuffer *rb, 00213 GLuint count, GLint x, GLint y, 00214 GLvoid *values, GLuint valueSize); 00215 00216 00217 extern void * 00218 _swrast_get_dest_rgba(GLcontext *ctx, struct gl_renderbuffer *rb, 00219 SWspan *span); 00220 00221 #endif Generated on Sat May 26 2012 04:19:33 for ReactOS by
1.7.6.1
|