diff options
Diffstat (limited to 'src/mesa/drivers/dri/glamo')
-rw-r--r-- | src/mesa/drivers/dri/glamo/Makefile | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/glamo/glamo_context.c | 16 | ||||
-rw-r--r-- | src/mesa/drivers/dri/glamo/glamo_context.h | 13 | ||||
-rw-r--r-- | src/mesa/drivers/dri/glamo/glamo_render.c | 189 | ||||
-rw-r--r-- | src/mesa/drivers/dri/glamo/glamo_render.h | 31 | ||||
-rw-r--r-- | src/mesa/drivers/dri/glamo/glamo_screen.c | 5 | ||||
-rw-r--r-- | src/mesa/drivers/dri/glamo/glamo_state.c | 20 | ||||
-rw-r--r-- | src/mesa/drivers/dri/glamo/glamo_tris.c | 163 | ||||
-rw-r--r-- | src/mesa/drivers/dri/glamo/glamo_tris.h | 9 |
9 files changed, 427 insertions, 21 deletions
diff --git a/src/mesa/drivers/dri/glamo/Makefile b/src/mesa/drivers/dri/glamo/Makefile index a917ffe20f..e77193d4be 100644 --- a/src/mesa/drivers/dri/glamo/Makefile +++ b/src/mesa/drivers/dri/glamo/Makefile @@ -7,7 +7,7 @@ LIBNAME = glamo_dri.so DRIVER_SOURCES = \ glamo_screen.c glamo_context.c glamo_state.c glamo_fbo.c glamo_tris.c \ - glamo_cmdq.c + glamo_cmdq.c glamo_render.c C_SOURCES = \ $(COMMON_SOURCES) \ diff --git a/src/mesa/drivers/dri/glamo/glamo_context.c b/src/mesa/drivers/dri/glamo/glamo_context.c index d60785cabb..6e86faf32e 100644 --- a/src/mesa/drivers/dri/glamo/glamo_context.c +++ b/src/mesa/drivers/dri/glamo/glamo_context.c @@ -41,6 +41,8 @@ #include "glamo_state.h" #include "glamo_fbo.h" #include "glamo_tris.h" +#include "glamo_render.h" +#include "glamo_cmdq.h" #include <glamo_bo.h> #include <glamo_bo_gem.h> @@ -102,7 +104,6 @@ GLboolean glamoCreateContext(const __GLcontextModes *glVisual, glamoContextPtr context; glamoScreenPtr glamoScreen; struct dd_function_table functions; - TNLcontext *tnl; context = (glamoContextPtr)CALLOC(sizeof(*context)); if ( context == NULL ) return GL_FALSE; @@ -139,9 +140,8 @@ GLboolean glamoCreateContext(const __GLcontextModes *glVisual, _tnl_CreateContext(ctx); _swsetup_CreateContext(ctx); - /* use default TCL pipeline */ - tnl = TNL_CONTEXT(ctx); - tnl->Driver.RunPipeline = _tnl_run_pipeline; + /* Install our pipeline (see glamo_render.c) */ + _tnl_install_pipeline(ctx, glamo_pipeline); _swrast_allow_pixel_fog(ctx, GL_TRUE); _swrast_allow_vertex_fog(ctx, GL_FALSE); @@ -194,10 +194,14 @@ static void glamo_update_renderbuffers(__DRIcontext *context, screen = context->driScreenPriv; glamo = (glamoContextPtr)context->driverPrivate; i = 0; - if ( draw->color_rb[0] ) + if ( draw->color_rb[0] ) { + printf("Attaching front left buffer\n"); attachments[i++] = __DRI_BUFFER_FRONT_LEFT; - if ( draw->color_rb[1] ) + } + if ( draw->color_rb[1] ) { + printf("Attaching back left buffer\n"); attachments[i++] = __DRI_BUFFER_BACK_LEFT; + } buffers = screen->dri2.loader->getBuffers(drawable, &drawable->w, diff --git a/src/mesa/drivers/dri/glamo/glamo_context.h b/src/mesa/drivers/dri/glamo/glamo_context.h index c8bb10dbd8..624cfde239 100644 --- a/src/mesa/drivers/dri/glamo/glamo_context.h +++ b/src/mesa/drivers/dri/glamo/glamo_context.h @@ -52,6 +52,19 @@ struct glamo_context { int cmdq_obj_used; uint32_t *cmdq_objs; unsigned int *cmdq_obj_pos; + + /* Information about the current primitive */ + struct { + GLuint id; + uint32_t primitive; /**< Current hardware primitive type */ + void (*flush) (struct glamo_context *); + struct glamo_bo *vb_bo; + uint8_t *vb; + unsigned int start_offset; /**< Byte offset of start */ + unsigned int current_offset; /**< Byte offset of next vertex */ + unsigned int count; /**< Number of vertices */ + } prim; + }; #define GLAMO_CONTEXT(ctx) ((glamoContextPtr)(ctx->DriverCtx)) diff --git a/src/mesa/drivers/dri/glamo/glamo_render.c b/src/mesa/drivers/dri/glamo/glamo_render.c new file mode 100644 index 0000000000..3e7aec2dc5 --- /dev/null +++ b/src/mesa/drivers/dri/glamo/glamo_render.c @@ -0,0 +1,189 @@ +/* + * Direct Rendering Support for SMedia Glamo 336x/337x + * + * (c) 2009 Thomas White <taw@bitwiz.org.uk> + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * + * Based on intel_render.c, to which the following notice applies: + * + * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + + +/* + * Render unclipped vertex buffers by emitting vertices directly to + * dma buffers. Use strip/fan hardware acceleration where possible. + * + */ +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/imports.h" +#include "main/mtypes.h" +#include "main/enums.h" + +#include "tnl/t_context.h" +#include "tnl/t_vertex.h" +#include "tnl/t_pipeline.h" + +#include "glamo_context.h" +#include "glamo_tris.h" + +/* + * Render unclipped vertex buffers by emitting vertices directly to + * VRAM buffers. Use strip/fan hardware primitives where possible. + * Try to simulate missing primitives with indexed vertices. + */ +#define HAVE_POINTS 0 +#define HAVE_LINES 1 +#define HAVE_LINE_STRIPS 1 +#define HAVE_TRIANGLES 1 +#define HAVE_TRI_STRIPS 1 +#define HAVE_TRI_STRIP_1 0 /* Has it, template can't use it yet */ +#define HAVE_TRI_FANS 1 +#define HAVE_POLYGONS 1 +#define HAVE_QUADS 0 +#define HAVE_QUAD_STRIPS 0 +#define HAVE_ELTS 0 + + +static inline GLuint glamoGetVBMax(struct glamo_context *glamo) +{ + return GLAMO_VB_SIZE / (4 * 4); +} + +static inline GLuint glamoGetCurrentMax(struct glamo_context *glamo) +{ + /* How many more vertices can be accommodated? + * Each vertex takes up 4x 32-bit fixed point values */ + return (GLAMO_VB_SIZE - glamo->prim.current_offset) / (4 * 4); +} + +#define LOCAL_VARS \ + struct glamo_context *gCtx = GLAMO_CONTEXT(ctx); + +#define INIT(prim) + +#define FLUSH() \ + do { \ + if ((gCtx)->prim.flush) \ + (gCtx)->prim.flush(gCtx); \ + } while (0) + +#define GET_SUBSEQUENT_VB_MAX_VERTS() glamoGetVBMax(gCtx) +#define GET_CURRENT_VB_MAX_VERTS() glamoGetCurrentMax(gCtx) + +#define ALLOC_VERTS(nr) glamoGetPrimSpace(gCtx, nr) + +#define EMIT_VERTS(ctx, j, nr, buf) \ + _tnl_emit_vertices_to_buffer(ctx, j, (j)+(nr), buf) + +#define TAG(x) glamo_##x +#include "tnl_dd/t_dd_dmatmp.h" + + +/**********************************************************************/ +/* Render pipeline stage */ +/**********************************************************************/ + + +static GLboolean glamoRunRender(GLcontext *ctx, + struct tnl_pipeline_stage *stage) +{ + struct glamo_context *gCtx = GLAMO_CONTEXT(ctx); + TNLcontext *tnl = TNL_CONTEXT(ctx); + struct vertex_buffer *VB = &tnl->vb; + GLuint i; + + /* Don't handle clipping */ + if ( !glamo_validate_render(ctx, VB) ) { + return GL_TRUE; /* Failed */ + } + + tnl->clipspace.new_inputs |= VERT_BIT_POS; + + tnl->Driver.Render.Start(ctx); + + for ( i=0; i<VB->PrimitiveCount; i++ ) { + GLuint prim = _tnl_translate_prim(&VB->Primitive[i]); + GLuint start = VB->Primitive[i].start; + GLuint length = VB->Primitive[i].count; + + if (!length) continue; + + glamo_render_tab_verts[prim & PRIM_MODE_MASK](ctx, start, + start + length, prim); + } + + tnl->Driver.Render.Finish(ctx); + + if ((gCtx)->prim.flush) + (gCtx)->prim.flush(gCtx); + + return GL_FALSE; /* Ok */ +} + + +static const struct tnl_pipeline_stage _glamo_render_stage = { + "glamo render", + NULL, + NULL, + NULL, + NULL, + glamoRunRender +}; + + +const struct tnl_pipeline_stage *glamo_pipeline[] = { + &_tnl_vertex_transform_stage, + &_tnl_vertex_cull_stage, + &_tnl_normal_transform_stage, + &_tnl_lighting_stage, + &_tnl_fog_coordinate_stage, + &_tnl_texgen_stage, + &_tnl_texture_transform_stage, + &_tnl_point_attenuation_stage, + &_tnl_vertex_program_stage, + &_glamo_render_stage, /* ADD: unclipped rastersetup-to-dma */ + &_tnl_render_stage, + 0, +}; diff --git a/src/mesa/drivers/dri/glamo/glamo_render.h b/src/mesa/drivers/dri/glamo/glamo_render.h new file mode 100644 index 0000000000..99c36a8e37 --- /dev/null +++ b/src/mesa/drivers/dri/glamo/glamo_render.h @@ -0,0 +1,31 @@ +/* + * Direct Rendering Support for SMedia Glamo 336x/337x + * + * (c) 2009 Thomas White <taw@bitwiz.org.uk> + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef __GLAMO_RENDER_H +#define __GLAMO_RENDER_H + +#include "main/mtypes.h" + +extern const struct tnl_pipeline_stage *glamo_pipeline[]; + +#endif /* __GLAMO_RENDER_H */ diff --git a/src/mesa/drivers/dri/glamo/glamo_screen.c b/src/mesa/drivers/dri/glamo/glamo_screen.c index 82f2f6233d..c8ecb37868 100644 --- a/src/mesa/drivers/dri/glamo/glamo_screen.c +++ b/src/mesa/drivers/dri/glamo/glamo_screen.c @@ -81,6 +81,8 @@ static const __DRIconfig **glamoInitScreen(__DRIscreenPrivate *sPriv) uint8_t stencil_bits_array[2]; static const GLenum db_modes[] = { GLX_SWAP_COPY_OML, GLX_NONE }; + printf("glamoInitScreen!\n"); + /* Driver initialisation */ if ( glamoInitDriver(sPriv) ) { return NULL; @@ -118,6 +120,8 @@ static const __DRIconfig **glamoInitScreen2(__DRIscreenPrivate *sPriv) uint8_t stencil_bits_array[2]; static const GLenum db_modes[] = { GLX_SWAP_COPY_OML, GLX_NONE }; + printf("glamoInitScreen2!\n"); + /* Driver initialisation */ if ( glamoInitDriver(sPriv) ) { return NULL; @@ -154,7 +158,6 @@ static GLboolean glamoCreateBuffer(__DRIscreen *driScrnPriv, const __GLcontextModes *mesaVis, GLboolean isPixmap) { - glamoScreenPtr screen = (glamoScreenPtr)driScrnPriv->private; struct glamo_framebuffer *gfb; GLenum rgbFormat; diff --git a/src/mesa/drivers/dri/glamo/glamo_state.c b/src/mesa/drivers/dri/glamo/glamo_state.c index 2190fbeee7..795d62b058 100644 --- a/src/mesa/drivers/dri/glamo/glamo_state.c +++ b/src/mesa/drivers/dri/glamo/glamo_state.c @@ -105,20 +105,20 @@ static void glamoClear(GLcontext *ctx, GLbitfield mask) grb = glamo_renderbuffer(fb->_ColorDrawBuffers[i]); - GlamoDRMAddCommandBO(gCtx, GLAMO_REG_2D_DST_ADDRL, grb->bo); - GlamoDRMAddCommand(gCtx, GLAMO_REG_2D_DST_PITCH, + glamoDRMAddCommandBO(gCtx, GLAMO_REG_2D_DST_ADDRL, grb->bo); + glamoDRMAddCommand(gCtx, GLAMO_REG_2D_DST_PITCH, grb->width & 0x7ff); - GlamoDRMAddCommand(gCtx, GLAMO_REG_2D_DST_HEIGHT, + glamoDRMAddCommand(gCtx, GLAMO_REG_2D_DST_HEIGHT, grb->height); - GlamoDRMAddCommand(gCtx, GLAMO_REG_2D_PAT_FG, 0xabcd); - GlamoDRMAddCommand(gCtx, GLAMO_REG_2D_COMMAND2, 0xff); /* set */ - GlamoDRMAddCommand(gCtx, GLAMO_REG_2D_DST_X, fb->_Xmin); - GlamoDRMAddCommand(gCtx, GLAMO_REG_2D_DST_Y, fb->_Ymin); - GlamoDRMAddCommand(gCtx, GLAMO_REG_2D_RECT_WIDTH, + glamoDRMAddCommand(gCtx, GLAMO_REG_2D_PAT_FG, 0xabcd); + glamoDRMAddCommand(gCtx, GLAMO_REG_2D_COMMAND2, 0xff); /* set */ + glamoDRMAddCommand(gCtx, GLAMO_REG_2D_DST_X, fb->_Xmin); + glamoDRMAddCommand(gCtx, GLAMO_REG_2D_DST_Y, fb->_Ymin); + glamoDRMAddCommand(gCtx, GLAMO_REG_2D_RECT_WIDTH, fb->_Xmax-fb->_Xmin); - GlamoDRMAddCommand(gCtx, GLAMO_REG_2D_RECT_HEIGHT, + glamoDRMAddCommand(gCtx, GLAMO_REG_2D_RECT_HEIGHT, fb->_Ymax-fb->_Ymin); - GlamoDRMAddCommand(gCtx, GLAMO_REG_2D_COMMAND3, 0); + glamoDRMAddCommand(gCtx, GLAMO_REG_2D_COMMAND3, 0); } } diff --git a/src/mesa/drivers/dri/glamo/glamo_tris.c b/src/mesa/drivers/dri/glamo/glamo_tris.c index aa1a09b5ec..22c70004b4 100644 --- a/src/mesa/drivers/dri/glamo/glamo_tris.c +++ b/src/mesa/drivers/dri/glamo/glamo_tris.c @@ -19,6 +19,33 @@ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * + * Based on intel_tris.c, to which the following notice applies: + * + * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * */ @@ -26,22 +53,30 @@ #include "swrast/swrast.h" #include "tnl/t_context.h" #include "tnl/t_vertex.h" +#include "tnl/t_pipeline.h" #include "glamo_tris.h" +#include "glamo_context.h" static void glamoRunPipeline(GLcontext *ctx) { printf("glamoRunPipeline\n"); + + /* TODO: Emit state */ + + _tnl_run_pipeline(ctx); } +/* Unused */ static void glamoRenderStart(GLcontext *ctx) { printf("glamoRenderStart\n"); } +/* Unused */ static void glamoRenderFinish(GLcontext *ctx) { printf("glamoRenderFinish\n"); @@ -54,13 +89,137 @@ static void glamoPrimitiveNotify(GLcontext *ctx, GLenum prim) } +uint32_t *glamoGetPrimSpace(struct glamo_context *gCtx, unsigned int count) +{ + uint32_t *addr; + +#if 0 + if (intel->intelScreen->no_vbo) { + return intel_extend_inline(intel, count * intel->vertex_size); + } + + /* Check for space in the existing VB */ + if (intel->prim.vb_bo == NULL || + (intel->prim.current_offset + + count * intel->vertex_size * 4) > INTEL_VB_SIZE || + (intel->prim.count + count) >= (1 << 16)) { + /* Flush existing prim if any */ + INTEL_FIREVERTICES(intel); + + intel_finish_vb(intel); + + /* Start a new VB */ + if (intel->prim.vb == NULL) + intel->prim.vb = malloc(INTEL_VB_SIZE); + intel->prim.vb_bo = dri_bo_alloc(intel->bufmgr, "vb", + INTEL_VB_SIZE, 4); + intel->prim.start_offset = 0; + intel->prim.current_offset = 0; + } + + intel->prim.flush = intel_flush_prim; + + addr = (uint32_t *)(intel->prim.vb + intel->prim.current_offset); + intel->prim.current_offset += intel->vertex_size * 4 * count; + intel->prim.count += count; +#endif + + return addr; +} + +#define IND (0) +#define TAG(x) x +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (0) +#define TAG(x) x##_offset +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (0) +#define TAG(x) x##_twoside +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (0) +#define TAG(x) x##_twoside_offset +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (0) +#define TAG(x) x##_unfilled +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (0) +#define TAG(x) x##_offset_unfilled +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (0) +#define TAG(x) x##_twoside_unfilled +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (0) +#define TAG(x) x##_twoside_offset_unfilled +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (0) +#define TAG(x) x##_fallback +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (0) +#define TAG(x) x##_offset_fallback +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (0) +#define TAG(x) x##_twoside_fallback +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (0) +#define TAG(x) x##_twoside_offset_fallback +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (0) +#define TAG(x) x##_unfilled_fallback +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (0) +#define TAG(x) x##_offset_unfilled_fallback +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (0) +#define TAG(x) x##_twoside_unfilled_fallback +#include "tnl_dd/t_dd_tritmp.h" + +#define IND (0) +#define TAG(x) x##_twoside_offset_unfilled_fallback +#include "tnl_dd/t_dd_tritmp.h" + + +static void init_rast_tab() +{ + init(); + init_offset(); + init_twoside(); + init_twoside_offset(); + init_unfilled(); + init_offset_unfilled(); + init_twoside_unfilled(); + init_twoside_offset_unfilled(); + init_fallback(); + init_offset_fallback(); + init_twoside_fallback(); + init_twoside_offset_fallback(); + init_unfilled_fallback(); + init_offset_unfilled_fallback(); + init_twoside_unfilled_fallback(); + init_twoside_offset_unfilled_fallback(); +} + + void glamoInitTriFuncs(GLcontext *ctx) { TNLcontext *tnl = TNL_CONTEXT(ctx); static int firsttime = 1; if (firsttime) { - //init_rast_tab(); + init_rast_tab(); firsttime = 0; } @@ -70,4 +229,6 @@ void glamoInitTriFuncs(GLcontext *ctx) tnl->Driver.Render.PrimitiveNotify = glamoPrimitiveNotify; tnl->Driver.Render.ResetLineStipple = _swrast_ResetLineStipple; tnl->Driver.Render.BuildVertices = _tnl_build_vertices; + tnl->Driver.Render.CopyPV = _tnl_copy_pv; + tnl->Driver.Render.Interp = _tnl_interp; } diff --git a/src/mesa/drivers/dri/glamo/glamo_tris.h b/src/mesa/drivers/dri/glamo/glamo_tris.h index a0f0c2d342..ba8f99742b 100644 --- a/src/mesa/drivers/dri/glamo/glamo_tris.h +++ b/src/mesa/drivers/dri/glamo/glamo_tris.h @@ -26,8 +26,13 @@ #include "main/mtypes.h" +#include "glamo_context.h" + +/* Amount of space reserved for vertex submission */ +#define GLAMO_VB_SIZE (32*1024) + extern void glamoInitTriFuncs(GLcontext *ctx); +extern uint32_t *glamoGetPrimSpace(struct glamo_context *gCtx, + unsigned int count); #endif /* __GLAMO_TRIS_H */ - -/* kate: space-indent on; indent-width 3; mixedindent off; indent-mode cstyle; */ |