Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygent_vertex.h
Go to the documentation of this file.
00001 /* 00002 * Copyright 2003 Tungsten Graphics, inc. 00003 * All Rights Reserved. 00004 * 00005 * Permission is hereby granted, free of charge, to any person obtaining a 00006 * copy of this software and associated documentation files (the "Software"), 00007 * to deal in the Software without restriction, including without limitation 00008 * on the rights to use, copy, modify, merge, publish, distribute, sub 00009 * license, and/or sell copies of the Software, and to permit persons to whom 00010 * the Software is furnished to do so, subject to the following conditions: 00011 * 00012 * The above copyright notice and this permission notice (including the next 00013 * paragraph) shall be included in all copies or substantial portions of the 00014 * Software. 00015 * 00016 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00017 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00018 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 00019 * TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, 00020 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 00021 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 00022 * USE OR OTHER DEALINGS IN THE SOFTWARE. 00023 * 00024 * Authors: 00025 * Keith Whitwell <keithw@tungstengraphics.com> 00026 */ 00027 00028 #ifndef _TNL_VERTEX_H 00029 #define _TNL_VERTEX_H 00030 00031 #include "main/mtypes.h" 00032 #include "t_context.h" 00033 00034 /* New mechanism to specify hardware vertices so that tnl can build 00035 * and manipulate them directly. 00036 */ 00037 00038 00039 /* It will probably be necessary to allow drivers to specify new 00040 * emit-styles to cover all the wierd and wacky things out there. 00041 */ 00042 enum tnl_attr_format { 00043 EMIT_1F, 00044 EMIT_2F, 00045 EMIT_3F, 00046 EMIT_4F, 00047 EMIT_2F_VIEWPORT, /* do viewport transform and emit */ 00048 EMIT_3F_VIEWPORT, /* do viewport transform and emit */ 00049 EMIT_4F_VIEWPORT, /* do viewport transform and emit */ 00050 EMIT_3F_XYW, /* for projective texture */ 00051 EMIT_1UB_1F, /* for fog coordinate */ 00052 EMIT_3UB_3F_RGB, /* for specular color */ 00053 EMIT_3UB_3F_BGR, /* for specular color */ 00054 EMIT_4UB_4F_RGBA, /* for color */ 00055 EMIT_4UB_4F_BGRA, /* for color */ 00056 EMIT_4UB_4F_ARGB, /* for color */ 00057 EMIT_4UB_4F_ABGR, /* for color */ 00058 EMIT_4CHAN_4F_RGBA, /* for swrast color */ 00059 EMIT_PAD, /* leave a hole of 'offset' bytes */ 00060 EMIT_MAX 00061 }; 00062 00063 struct tnl_attr_map { 00064 GLuint attrib; /* _TNL_ATTRIB_ enum */ 00065 enum tnl_attr_format format; 00066 GLuint offset; 00067 }; 00068 00069 struct tnl_format_info { 00070 const char *name; 00071 tnl_extract_func extract; 00072 tnl_insert_func insert[4]; 00073 const GLuint attrsize; 00074 }; 00075 00076 extern const struct tnl_format_info _tnl_format_info[EMIT_MAX]; 00077 00078 00079 /* Interpolate between two vertices to produce a third: 00080 */ 00081 extern void _tnl_interp( GLcontext *ctx, 00082 GLfloat t, 00083 GLuint edst, GLuint eout, GLuint ein, 00084 GLboolean force_boundary ); 00085 00086 /* Copy colors from one vertex to another: 00087 */ 00088 extern void _tnl_copy_pv( GLcontext *ctx, GLuint edst, GLuint esrc ); 00089 00090 00091 /* Extract a named attribute from a hardware vertex. Will have to 00092 * reverse any viewport transformation, swizzling or other conversions 00093 * which may have been applied: 00094 */ 00095 extern void _tnl_get_attr( GLcontext *ctx, const void *vertex, GLenum attrib, 00096 GLfloat *dest ); 00097 00098 /* Complementary to the above. 00099 */ 00100 extern void _tnl_set_attr( GLcontext *ctx, void *vout, GLenum attrib, 00101 const GLfloat *src ); 00102 00103 00104 extern void *_tnl_get_vertex( GLcontext *ctx, GLuint nr ); 00105 00106 extern GLuint _tnl_install_attrs( GLcontext *ctx, 00107 const struct tnl_attr_map *map, 00108 GLuint nr, const GLfloat *vp, 00109 GLuint unpacked_size ); 00110 00111 extern void _tnl_free_vertices( GLcontext *ctx ); 00112 00113 extern void _tnl_init_vertices( GLcontext *ctx, 00114 GLuint vb_size, 00115 GLuint max_vertex_size ); 00116 00117 extern void *_tnl_emit_vertices_to_buffer( GLcontext *ctx, 00118 GLuint start, 00119 GLuint end, 00120 void *dest ); 00121 00122 /* This function isn't optimal. Check out 00123 * gallium/auxilary/translate for a more comprehensive implementation of 00124 * the same functionality. 00125 */ 00126 00127 extern void *_tnl_emit_indexed_vertices_to_buffer( GLcontext *ctx, 00128 const GLuint *elts, 00129 GLuint start, 00130 GLuint end, 00131 void *dest ); 00132 00133 00134 extern void _tnl_build_vertices( GLcontext *ctx, 00135 GLuint start, 00136 GLuint end, 00137 GLuint newinputs ); 00138 00139 extern void _tnl_invalidate_vertices( GLcontext *ctx, GLuint newinputs ); 00140 00141 extern void _tnl_invalidate_vertex_state( GLcontext *ctx, GLuint new_state ); 00142 00143 extern void _tnl_notify_pipeline_output_change( GLcontext *ctx ); 00144 00145 00146 #define GET_VERTEX_STATE(ctx) &(TNL_CONTEXT(ctx)->clipspace) 00147 00148 /* Internal function: 00149 */ 00150 void _tnl_register_fastpath( struct tnl_clipspace *vtx, 00151 GLboolean match_strides ); 00152 00153 00154 /* t_vertex_generic.c -- Internal functions for t_vertex.c 00155 */ 00156 void _tnl_generic_copy_pv_extras( GLcontext *ctx, 00157 GLuint dst, GLuint src ); 00158 00159 void _tnl_generic_interp_extras( GLcontext *ctx, 00160 GLfloat t, 00161 GLuint dst, GLuint out, GLuint in, 00162 GLboolean force_boundary ); 00163 00164 void _tnl_generic_copy_pv( GLcontext *ctx, GLuint edst, GLuint esrc ); 00165 00166 void _tnl_generic_interp( GLcontext *ctx, 00167 GLfloat t, 00168 GLuint edst, GLuint eout, GLuint ein, 00169 GLboolean force_boundary ); 00170 00171 void _tnl_generic_emit( GLcontext *ctx, 00172 GLuint count, 00173 GLubyte *v ); 00174 00175 void _tnl_generate_hardwired_emit( GLcontext *ctx ); 00176 00177 /* t_vertex_sse.c -- Internal functions for t_vertex.c 00178 */ 00179 void _tnl_generate_sse_emit( GLcontext *ctx ); 00180 00181 #endif Generated on Sat May 26 2012 04:19:36 for ReactOS by
1.7.6.1
|