ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

vbo_exec.h
Go to the documentation of this file.
00001 /**************************************************************************
00002 
00003 Copyright 2002 Tungsten Graphics Inc., Cedar Park, Texas.
00004 
00005 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 on the rights to use, copy, modify, merge, publish, distribute, sub
00011 license, and/or sell copies of the Software, and to permit persons to whom
00012 the Software is furnished to do so, subject to the following conditions:
00013 
00014 The above copyright notice and this permission notice (including the next
00015 paragraph) shall be included in all copies or substantial portions of the
00016 Software.
00017 
00018 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00019 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00020 FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
00021 TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
00022 DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
00023 OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
00024 USE OR OTHER DEALINGS IN THE SOFTWARE.
00025 
00026 **************************************************************************/
00027 
00028 /*
00029  * Authors:
00030  *   Keith Whitwell <keith@tungstengraphics.com>
00031  *
00032  */
00033 
00034 #ifndef __VBO_EXEC_H__
00035 #define __VBO_EXEC_H__
00036 
00037 #include "main/mtypes.h"
00038 #include "vbo.h"
00039 #include "vbo_attrib.h"
00040 
00041 
00042 #define VBO_MAX_PRIM 64
00043 
00044 /* Wierd implementation stuff:
00045  */
00046 #define VBO_VERT_BUFFER_SIZE (1024*16)  /* dwords == 64k */
00047 #define VBO_MAX_ATTR_CODEGEN 16 
00048 #define ERROR_ATTRIB 16
00049 
00050 
00051 
00052 
00053 struct vbo_exec_eval1_map {
00054    struct gl_1d_map *map;
00055    GLuint sz;
00056 };
00057 
00058 struct vbo_exec_eval2_map {
00059    struct gl_2d_map *map;
00060    GLuint sz;
00061 };
00062 
00063 
00064 
00065 struct vbo_exec_copied_vtx {
00066    GLfloat buffer[VBO_ATTRIB_MAX * 4 * VBO_MAX_COPIED_VERTS];
00067    GLuint nr;
00068 };
00069 
00070 
00071 typedef void (*vbo_attrfv_func)( const GLfloat * );
00072 
00073 
00074 struct vbo_exec_context
00075 {
00076    GLcontext *ctx;   
00077    GLvertexformat vtxfmt;
00078 
00079    struct {
00080       struct gl_buffer_object *bufferobj;
00081       GLubyte *buffer_map;
00082 
00083       GLuint vertex_size;
00084 
00085       struct _mesa_prim prim[VBO_MAX_PRIM];
00086       GLuint prim_count;
00087 
00088       GLfloat *vbptr;            /* cursor, points into buffer */
00089       GLfloat vertex[VBO_ATTRIB_MAX*4]; /* current vertex */
00090 
00091       GLuint vert_count;
00092       GLuint max_vert;
00093       struct vbo_exec_copied_vtx copied;
00094 
00095       GLubyte attrsz[VBO_ATTRIB_MAX];
00096       GLubyte active_sz[VBO_ATTRIB_MAX];
00097 
00098       GLfloat *attrptr[VBO_ATTRIB_MAX]; 
00099       struct gl_client_array arrays[VBO_ATTRIB_MAX];
00100 
00101       /* According to program mode, the values above plus current
00102        * values are squashed down to the 32 attributes passed to the
00103        * vertex program below:
00104        */
00105       GLuint program_mode;
00106       GLuint enabled_flags;
00107       const struct gl_client_array *inputs[VERT_ATTRIB_MAX];
00108    } vtx;
00109 
00110    
00111    struct {
00112       GLboolean recalculate_maps;
00113       struct vbo_exec_eval1_map map1[VERT_ATTRIB_MAX];
00114       struct vbo_exec_eval2_map map2[VERT_ATTRIB_MAX];
00115    } eval;
00116 
00117    struct {
00118       GLuint program_mode;
00119       GLuint enabled_flags;
00120       GLuint array_obj;
00121 
00122       /* These just mirror the current arrayobj (todo: make arrayobj
00123        * look like this and remove the mirror):
00124        */
00125       const struct gl_client_array *legacy_array[16];
00126       const struct gl_client_array *generic_array[16];
00127 
00128       /* Arrays and current values manipulated according to program
00129        * mode, etc.  These are the attributes as seen by vertex
00130        * programs:
00131        */
00132       const struct gl_client_array *inputs[VERT_ATTRIB_MAX];
00133    } array;
00134 };
00135 
00136 
00137 
00138 /* External API:
00139  */
00140 void vbo_exec_init( GLcontext *ctx );
00141 void vbo_exec_destroy( GLcontext *ctx );
00142 void vbo_exec_invalidate_state( GLcontext *ctx, GLuint new_state );
00143 void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags );
00144 
00145 
00146 /* Internal functions:
00147  */
00148 void vbo_exec_array_init( struct vbo_exec_context *exec );
00149 void vbo_exec_array_destroy( struct vbo_exec_context *exec );
00150 
00151 
00152 void vbo_exec_vtx_init( struct vbo_exec_context *exec );
00153 void vbo_exec_vtx_destroy( struct vbo_exec_context *exec );
00154 void vbo_exec_vtx_flush( struct vbo_exec_context *exec );
00155 void vbo_exec_vtx_wrap( struct vbo_exec_context *exec );
00156 
00157 void vbo_exec_eval_update( struct vbo_exec_context *exec );
00158 
00159 void vbo_exec_do_EvalCoord2f( struct vbo_exec_context *exec, 
00160                      GLfloat u, GLfloat v );
00161 
00162 void vbo_exec_do_EvalCoord1f( struct vbo_exec_context *exec,
00163                      GLfloat u);
00164 
00165 extern GLboolean 
00166 vbo_validate_shaders(GLcontext *ctx);
00167 
00168 #endif

Generated on Sun May 27 2012 04:20:48 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.