diff options
author | Michel Dänzer <[email protected]> | 2007-02-03 17:37:01 +0100 |
---|---|---|
committer | Michel Dänzer <[email protected]> | 2007-02-03 17:37:01 +0100 |
commit | 5aa997dafbe9cccba2c837d64ddc06e495f6fd71 (patch) | |
tree | 324fc86dad44390c5914a9742525aa78c695157d /src | |
parent | cf4ccd5020743591b8d2b29df279c729004ca393 (diff) | |
parent | de24b01b05d4c7402c06851dd7dbbb5854b1ff41 (diff) |
Merge branch 'origin'
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nv10_state.c | 19 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r200/r200_context.h | 124 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r200/r200_maos_arrays.c | 7 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r200/r200_state.c | 12 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r200/r200_vertprog.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_context.h | 111 |
6 files changed, 20 insertions, 255 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nv10_state.c b/src/mesa/drivers/dri/nouveau/nv10_state.c index f6e47b7f480..88c1d7d9e1d 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_state.c +++ b/src/mesa/drivers/dri/nouveau/nv10_state.c @@ -612,10 +612,13 @@ static void nv10WindowMoved(nouveauContextPtr nmesa) OUT_RING_CACHE((h << 16) | y); /* something to do with clears, possibly doesn't belong here */ + BEGIN_RING_SIZE(NvSub3D, 0x02b4, 1); + OUT_RING(0); + BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_VIEWPORT_CLIP_HORIZ(0), 2); - OUT_RING_CACHE(((w+x) << 16) | x | 0x800); - OUT_RING_CACHE(((h+y) << 16) | y | 0x800); + OUT_RING_CACHE(((w+x-1) << 16) | x | 0x08000800); + OUT_RING_CACHE(((h+y-1) << 16) | y | 0x08000800); for (i=1; i<7; i++) { BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_VIEWPORT_CLIP_HORIZ(i), 1); @@ -651,14 +654,12 @@ static GLboolean nv10InitCard(nouveauContextPtr nmesa) OUT_RING(NvDmaFB); /* 194 dma_in_memory2 */ OUT_RING(NvDmaFB); /* 198 dma_in_memory3 */ - BEGIN_RING_SIZE(NvSub3D, 0x02b4, 1); - OUT_RING(0); BEGIN_RING_SIZE(NvSub3D, 0x0290, 1); OUT_RING(0x00100001); BEGIN_RING_SIZE(NvSub3D, 0x03f4, 1); OUT_RING(0); - return GL_FALSE; + return GL_TRUE; } /* Update buffer offset/pitch/format */ @@ -667,7 +668,7 @@ static GLboolean nv10BindBuffers(nouveauContextPtr nmesa, int num_color, nouveau_renderbuffer *depth) { GLuint x, y, w, h; - GLuint pitch, format; + GLuint pitch, format, depth_pitch; w = color[0]->mesa.Width; h = color[0]->mesa.Height; @@ -680,10 +681,8 @@ static GLboolean nv10BindBuffers(nouveauContextPtr nmesa, int num_color, BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_VIEWPORT_HORIZ, 6); OUT_RING_CACHE((w << 16) | x); OUT_RING_CACHE((h << 16) | y); - pitch = color[0]->pitch; - if (depth) { - pitch |= (depth->pitch << 16); - } + depth_pitch = (depth ? depth->pitch : color[0]->pitch); + pitch = (depth_pitch<<16) | color[0]->pitch; format = 0x108; if (color[0]->mesa._ActualFormat != GL_RGBA8) { format = 0x103; /* R5G6B5 color buffer */ diff --git a/src/mesa/drivers/dri/r200/r200_context.h b/src/mesa/drivers/dri/r200/r200_context.h index 44c67b68cbc..26a43d20dda 100644 --- a/src/mesa/drivers/dri/r200/r200_context.h +++ b/src/mesa/drivers/dri/r200/r200_context.h @@ -724,8 +724,6 @@ struct r200_store { /* r200_tcl.c */ struct r200_tcl_info { - GLuint vertex_format; - GLint last_offset; GLuint hw_primitive; /* hw can handle 12 components max */ @@ -812,87 +810,6 @@ struct r200_ioctl { #define R200_MAX_PRIMS 64 -/* Want to keep a cache of these around. Each is parameterized by - * only a single value which has only a small range. Only expect a - * few, so just rescan the list each time? - */ -struct dynfn { - struct dynfn *next, *prev; - int key[2]; - char *code; -}; - -struct dfn_lists { - struct dynfn Vertex2f; - struct dynfn Vertex2fv; - struct dynfn Vertex3f; - struct dynfn Vertex3fv; - struct dynfn Color4ub; - struct dynfn Color4ubv; - struct dynfn Color3ub; - struct dynfn Color3ubv; - struct dynfn Color4f; - struct dynfn Color4fv; - struct dynfn Color3f; - struct dynfn Color3fv; - struct dynfn SecondaryColor3ubEXT; - struct dynfn SecondaryColor3ubvEXT; - struct dynfn SecondaryColor3fEXT; - struct dynfn SecondaryColor3fvEXT; - struct dynfn Normal3f; - struct dynfn Normal3fv; - struct dynfn TexCoord3f; - struct dynfn TexCoord3fv; - struct dynfn TexCoord2f; - struct dynfn TexCoord2fv; - struct dynfn TexCoord1f; - struct dynfn TexCoord1fv; - struct dynfn MultiTexCoord3fARB; - struct dynfn MultiTexCoord3fvARB; - struct dynfn MultiTexCoord2fARB; - struct dynfn MultiTexCoord2fvARB; - struct dynfn MultiTexCoord1fARB; - struct dynfn MultiTexCoord1fvARB; - struct dynfn FogCoordfEXT; - struct dynfn FogCoordfvEXT; -}; - -struct dfn_generators { - struct dynfn *(*Vertex2f)( GLcontext *, const int * ); - struct dynfn *(*Vertex2fv)( GLcontext *, const int * ); - struct dynfn *(*Vertex3f)( GLcontext *, const int * ); - struct dynfn *(*Vertex3fv)( GLcontext *, const int * ); - struct dynfn *(*Color4ub)( GLcontext *, const int * ); - struct dynfn *(*Color4ubv)( GLcontext *, const int * ); - struct dynfn *(*Color3ub)( GLcontext *, const int * ); - struct dynfn *(*Color3ubv)( GLcontext *, const int * ); - struct dynfn *(*Color4f)( GLcontext *, const int * ); - struct dynfn *(*Color4fv)( GLcontext *, const int * ); - struct dynfn *(*Color3f)( GLcontext *, const int * ); - struct dynfn *(*Color3fv)( GLcontext *, const int * ); - struct dynfn *(*SecondaryColor3ubEXT)( GLcontext *, const int * ); - struct dynfn *(*SecondaryColor3ubvEXT)( GLcontext *, const int * ); - struct dynfn *(*SecondaryColor3fEXT)( GLcontext *, const int * ); - struct dynfn *(*SecondaryColor3fvEXT)( GLcontext *, const int * ); - struct dynfn *(*Normal3f)( GLcontext *, const int * ); - struct dynfn *(*Normal3fv)( GLcontext *, const int * ); - struct dynfn *(*TexCoord3f)( GLcontext *, const int * ); - struct dynfn *(*TexCoord3fv)( GLcontext *, const int * ); - struct dynfn *(*TexCoord2f)( GLcontext *, const int * ); - struct dynfn *(*TexCoord2fv)( GLcontext *, const int * ); - struct dynfn *(*TexCoord1f)( GLcontext *, const int * ); - struct dynfn *(*TexCoord1fv)( GLcontext *, const int * ); - struct dynfn *(*MultiTexCoord3fARB)( GLcontext *, const int * ); - struct dynfn *(*MultiTexCoord3fvARB)( GLcontext *, const int * ); - struct dynfn *(*MultiTexCoord2fARB)( GLcontext *, const int * ); - struct dynfn *(*MultiTexCoord2fvARB)( GLcontext *, const int * ); - struct dynfn *(*MultiTexCoord1fARB)( GLcontext *, const int * ); - struct dynfn *(*MultiTexCoord1fvARB)( GLcontext *, const int * ); - struct dynfn *(*FogCoordfEXT)( GLcontext *, const int * ); - struct dynfn *(*FogCoordfvEXT)( GLcontext *, const int * ); -}; - - struct r200_prim { GLuint start; @@ -913,43 +830,6 @@ struct r200_prim { #define R200_MAX_VERTEX_SIZE ((3*6)+11) -struct r200_vbinfo { - GLint counter, initial_counter; - GLint *dmaptr; - void (*notify)( void ); - GLint vertex_size; - - union { float f; int i; r200_color_t color; } vertex[R200_MAX_VERTEX_SIZE]; - - GLfloat *normalptr; - GLfloat *floatcolorptr; - GLfloat *fogptr; - r200_color_t *colorptr; - GLfloat *floatspecptr; - r200_color_t *specptr; - GLfloat *texcoordptr[8]; /* 6 (TMU) + 2 for r200_vtxfmt_c.c when GL_TEXTURE6/7 */ - - - GLenum *prim; /* &ctx->Driver.CurrentExecPrimitive */ - GLuint primflags; - GLboolean enabled; /* *_NO_VTXFMT / *_NO_TCL env vars */ - GLboolean installed; - GLboolean fell_back; - GLboolean recheck; - GLint nrverts; - GLuint vtxfmt_0, vtxfmt_1; - - GLuint installed_vertex_format; - GLuint installed_color_3f_sz; - - struct r200_prim primlist[R200_MAX_PRIMS]; - int nrprims; - - struct dfn_lists dfn_cache; - struct dfn_generators codegen; - GLvertexformat vtxfmt; -}; - struct r200_context { GLcontext *glCtx; /* Mesa context */ @@ -1041,10 +921,6 @@ struct r200_context { */ struct r200_swtcl_info swtcl; - /* r200_vtxfmt.c - */ - struct r200_vbinfo vb; - /* Mirrors of some DRI state */ struct r200_dri_mirror dri; diff --git a/src/mesa/drivers/dri/r200/r200_maos_arrays.c b/src/mesa/drivers/dri/r200/r200_maos_arrays.c index 270dc35a46a..db5ac6fc8a5 100644 --- a/src/mesa/drivers/dri/r200/r200_maos_arrays.c +++ b/src/mesa/drivers/dri/r200/r200_maos_arrays.c @@ -664,14 +664,13 @@ void r200EmitArrays( GLcontext *ctx, GLuint inputs ) */ if (vfmt0 != rmesa->hw.vtx.cmd[VTX_VTXFMT_0] || - vfmt1 != rmesa->hw.vtx.cmd[VTX_VTXFMT_1]) { - R200_STATECHANGE( rmesa, vtx ); + vfmt1 != rmesa->hw.vtx.cmd[VTX_VTXFMT_1]) { + R200_STATECHANGE( rmesa, vtx ); rmesa->hw.vtx.cmd[VTX_VTXFMT_0] = vfmt0; rmesa->hw.vtx.cmd[VTX_VTXFMT_1] = vfmt1; - } + } rmesa->tcl.nr_aos_components = nr; - rmesa->tcl.vertex_format = vfmt0; } diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c index bab767838d8..bdb487f2b93 100644 --- a/src/mesa/drivers/dri/r200/r200_state.c +++ b/src/mesa/drivers/dri/r200/r200_state.c @@ -2542,15 +2542,17 @@ static void r200InvalidateState( GLcontext *ctx, GLuint new_state ) } /* A hack. The r200 can actually cope just fine with materials - * between begin/ends, so fix this. But how ? + * between begin/ends, so fix this. + * Should map to inputs just like the generic vertex arrays for vertex progs. + * In theory there could still be too many and we'd still need a fallback. */ static GLboolean check_material( GLcontext *ctx ) { TNLcontext *tnl = TNL_CONTEXT(ctx); GLint i; - for (i = _TNL_ATTRIB_MAT_FRONT_AMBIENT; - i < _TNL_ATTRIB_MAT_BACK_INDEXES; + for (i = _TNL_ATTRIB_MAT_FRONT_AMBIENT; + i < _TNL_ATTRIB_MAT_BACK_INDEXES; i++) if (tnl->vb.AttribPtr[i] && tnl->vb.AttribPtr[i]->stride) @@ -2558,7 +2560,7 @@ static GLboolean check_material( GLcontext *ctx ) return GL_FALSE; } - + static void r200WrapRunPipeline( GLcontext *ctx ) { r200ContextPtr rmesa = R200_CONTEXT(ctx); @@ -2572,7 +2574,7 @@ static void r200WrapRunPipeline( GLcontext *ctx ) if (rmesa->NewGLState) r200ValidateState( ctx ); - has_material = (ctx->Light.Enabled && check_material( ctx )); + has_material = !ctx->VertexProgram._Enabled && ctx->Light.Enabled && check_material( ctx ); if (has_material) { TCL_FALLBACK( ctx, R200_TCL_FALLBACK_MATERIAL, GL_TRUE ); diff --git a/src/mesa/drivers/dri/r200/r200_vertprog.c b/src/mesa/drivers/dri/r200/r200_vertprog.c index 491701b796e..713e2f9ecab 100644 --- a/src/mesa/drivers/dri/r200/r200_vertprog.c +++ b/src/mesa/drivers/dri/r200/r200_vertprog.c @@ -461,7 +461,7 @@ static GLboolean r200_translate_vertex_program(GLcontext *ctx, struct r200_verte /* for fogc, can't change mesa_vp, as it would hose swtnl, and exp with base e isn't directly available neither. */ - if (mesa_vp->Base.OutputsWritten & VERT_RESULT_FOGC && !vp->fogpidx) { + if ((mesa_vp->Base.OutputsWritten & (1 << VERT_RESULT_FOGC)) && !vp->fogpidx) { struct gl_program_parameter_list *paramList; GLint tokens[6] = { STATE_FOG_PARAMS, 0, 0, 0, 0, 0 }; paramList = mesa_vp->Base.Parameters; diff --git a/src/mesa/drivers/dri/radeon/radeon_context.h b/src/mesa/drivers/dri/radeon/radeon_context.h index 0a7c3b2f544..02cea2f4e37 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.h +++ b/src/mesa/drivers/dri/radeon/radeon_context.h @@ -529,7 +529,6 @@ struct radeon_store { */ struct radeon_tcl_info { GLuint vertex_format; - GLint last_offset; GLuint hw_primitive; /* Temporary for cases where incoming vertex data is incompatible @@ -600,75 +599,6 @@ struct radeon_ioctl { #define RADEON_MAX_PRIMS 64 -/* Want to keep a cache of these around. Each is parameterized by - * only a single value which has only a small range. Only expect a - * few, so just rescan the list each time? - */ -struct dynfn { - struct dynfn *next, *prev; - int key; - char *code; -}; - -struct dfn_lists { - struct dynfn Vertex2f; - struct dynfn Vertex2fv; - struct dynfn Vertex3f; - struct dynfn Vertex3fv; - struct dynfn Color4ub; - struct dynfn Color4ubv; - struct dynfn Color3ub; - struct dynfn Color3ubv; - struct dynfn Color4f; - struct dynfn Color4fv; - struct dynfn Color3f; - struct dynfn Color3fv; - struct dynfn SecondaryColor3ubEXT; - struct dynfn SecondaryColor3ubvEXT; - struct dynfn SecondaryColor3fEXT; - struct dynfn SecondaryColor3fvEXT; - struct dynfn Normal3f; - struct dynfn Normal3fv; - struct dynfn TexCoord2f; - struct dynfn TexCoord2fv; - struct dynfn TexCoord1f; - struct dynfn TexCoord1fv; - struct dynfn MultiTexCoord2fARB; - struct dynfn MultiTexCoord2fvARB; - struct dynfn MultiTexCoord1fARB; - struct dynfn MultiTexCoord1fvARB; -}; - -struct dfn_generators { - struct dynfn *(*Vertex2f)( GLcontext *, int ); - struct dynfn *(*Vertex2fv)( GLcontext *, int ); - struct dynfn *(*Vertex3f)( GLcontext *, int ); - struct dynfn *(*Vertex3fv)( GLcontext *, int ); - struct dynfn *(*Color4ub)( GLcontext *, int ); - struct dynfn *(*Color4ubv)( GLcontext *, int ); - struct dynfn *(*Color3ub)( GLcontext *, int ); - struct dynfn *(*Color3ubv)( GLcontext *, int ); - struct dynfn *(*Color4f)( GLcontext *, int ); - struct dynfn *(*Color4fv)( GLcontext *, int ); - struct dynfn *(*Color3f)( GLcontext *, int ); - struct dynfn *(*Color3fv)( GLcontext *, int ); - struct dynfn *(*SecondaryColor3ubEXT)( GLcontext *, int ); - struct dynfn *(*SecondaryColor3ubvEXT)( GLcontext *, int ); - struct dynfn *(*SecondaryColor3fEXT)( GLcontext *, int ); - struct dynfn *(*SecondaryColor3fvEXT)( GLcontext *, int ); - struct dynfn *(*Normal3f)( GLcontext *, int ); - struct dynfn *(*Normal3fv)( GLcontext *, int ); - struct dynfn *(*TexCoord2f)( GLcontext *, int ); - struct dynfn *(*TexCoord2fv)( GLcontext *, int ); - struct dynfn *(*TexCoord1f)( GLcontext *, int ); - struct dynfn *(*TexCoord1fv)( GLcontext *, int ); - struct dynfn *(*MultiTexCoord2fARB)( GLcontext *, int ); - struct dynfn *(*MultiTexCoord2fvARB)( GLcontext *, int ); - struct dynfn *(*MultiTexCoord1fARB)( GLcontext *, int ); - struct dynfn *(*MultiTexCoord1fvARB)( GLcontext *, int ); -}; - - struct radeon_prim { GLuint start; @@ -685,43 +615,6 @@ struct radeon_prim { */ #define RADEON_MAX_VERTEX_SIZE 20 -struct radeon_vbinfo { - GLint counter, initial_counter; - GLint *dmaptr; - void (*notify)( void ); - GLint vertex_size; - - union { float f; int i; radeon_color_t color; } vertex[RADEON_MAX_VERTEX_SIZE]; - - GLfloat *normalptr; - GLfloat *floatcolorptr; - radeon_color_t *colorptr; - GLfloat *floatspecptr; - radeon_color_t *specptr; - GLfloat *texcoordptr[4]; /* 3 (TMU) + 1 for radeon_vtxfmt_c.c when GL_TEXTURE3 */ - - GLenum *prim; /* &ctx->Driver.CurrentExecPrimitive */ - GLuint primflags; - GLboolean enabled; /* *_NO_VTXFMT / *_NO_TCL env vars */ - GLboolean installed; - GLboolean fell_back; - GLboolean recheck; - GLint nrverts; - GLuint vertex_format; - - GLuint installed_vertex_format; - GLuint installed_color_3f_sz; - - struct radeon_prim primlist[RADEON_MAX_PRIMS]; - int nrprims; - - struct dfn_lists dfn_cache; - struct dfn_generators codegen; - GLvertexformat vtxfmt; -}; - - - struct radeon_context { GLcontext *glCtx; /* Mesa context */ @@ -808,10 +701,6 @@ struct radeon_context { */ struct radeon_swtcl_info swtcl; - /* radeon_vtxfmt.c - */ - struct radeon_vbinfo vb; - /* Mirrors of some DRI state */ struct radeon_dri_mirror dri; |