Cleaned stuff in the tcl code

This commit is contained in:
Stephane Marchesin 2006-04-14 22:41:16 +00:00
parent 5fd11335f6
commit 199512968b
6 changed files with 33 additions and 24 deletions

View file

@ -134,6 +134,7 @@ GLboolean nouveauCreateContext( const __GLcontextModes *glVisual,
case NV_04:
case NV_05:
default:
//nv03TriInitFunctions( ctx );
break;
case NV_10:
case NV_20:

View file

@ -88,6 +88,7 @@ typedef struct nouveau_context {
GLuint specular_offset;
/* The drawing fallbacks */
GLuint Fallback;
nouveau_tri_func* draw_tri;
nouveau_line_func* draw_line;
nouveau_point_func* draw_point;
@ -122,6 +123,18 @@ typedef struct nouveau_context {
#define NOUVEAU_CONTEXT(ctx) ((nouveauContextPtr)(ctx->DriverCtx))
#define NOUVEAU_FALLBACK_TEXTURE 0x0001
#define NOUVEAU_FALLBACK_DRAW_BUFFER 0x0002
#define NOUVEAU_FALLBACK_READ_BUFFER 0x0004
#define NOUVEAU_FALLBACK_STENCIL 0x0008
#define NOUVEAU_FALLBACK_RENDER_MODE 0x0010
#define NOUVEAU_FALLBACK_LOGICOP 0x0020
#define NOUVEAU_FALLBACK_SEP_SPECULAR 0x0040
#define NOUVEAU_FALLBACK_BLEND_EQ 0x0080
#define NOUVEAU_FALLBACK_BLEND_FUNC 0x0100
#define NOUVEAU_FALLBACK_PROJTEX 0x0200
#define NOUVEAU_FALLBACK_DISABLE 0x0400
extern GLboolean nouveauCreateContext( const __GLcontextModes *glVisual,
__DRIcontextPrivate *driContextPriv,

View file

@ -26,6 +26,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "nouveau_context.h"
#include "nouveau_tris.h"
#include "nv10_swtcl.h"
#include "nouveau_span.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
#include "tnl/tnl.h"
@ -44,9 +46,7 @@ void nouveau_fallback_tri(struct nouveau_context *nmesa,
_swsetup_Translate(ctx, v0, &v[0]);
_swsetup_Translate(ctx, v1, &v[1]);
_swsetup_Translate(ctx, v2, &v[2]);
nouveauSpanRenderStart( ctx );
_swrast_Triangle(ctx, &v[0], &v[1], &v[2]);
nouveauSpanRenderFinish( ctx );
}
@ -58,9 +58,7 @@ void nouveau_fallback_line(struct nouveau_context *nmesa,
SWvertex v[2];
_swsetup_Translate(ctx, v0, &v[0]);
_swsetup_Translate(ctx, v1, &v[1]);
nouveauSpanRenderStart( ctx );
_swrast_Line(ctx, &v[0], &v[1]);
nouveauSpanRenderFinish( ctx );
}
@ -70,12 +68,9 @@ void nouveau_fallback_point(struct nouveau_context *nmesa,
GLcontext *ctx = nmesa->glCtx;
SWvertex v[1];
_swsetup_Translate(ctx, v0, &v[0]);
nouveauSpanRenderStart( ctx );
_swrast_Point(ctx, &v[0]);
nouveauSpanRenderFinish( ctx );
}
void nouveauFallback(struct nouveau_context *nmesa, GLuint bit, GLboolean mode)
{
GLcontext *ctx = nmesa->glCtx;
@ -85,7 +80,11 @@ void nouveauFallback(struct nouveau_context *nmesa, GLuint bit, GLboolean mode)
if (mode) {
nmesa->Fallback |= bit;
if (oldfallback == 0) {
nv40FinishPrimitive(nmesa);
if (nmesa->screen->card_type<NV_10) {
//nv03FinishPrimitive(nmesa);
} else {
nv10FinishPrimitive(nmesa);
}
_swsetup_Wakeup(ctx);
nmesa->renderIndex = ~0;
@ -96,14 +95,7 @@ void nouveauFallback(struct nouveau_context *nmesa, GLuint bit, GLboolean mode)
if (oldfallback == bit) {
_swrast_flush( ctx );
tnl->Driver.Render.Start = nouveauRenderStart;
tnl->Driver.Render.PrimitiveNotify = nouveauRenderPrimitive;
tnl->Driver.Render.Finish = nouveauRenderFinish;
tnl->Driver.Render.BuildVertices = _tnl_build_vertices;
tnl->Driver.Render.CopyPV = _tnl_copy_pv;
tnl->Driver.Render.Interp = _tnl_interp;
tnl->Driver.Render.ResetLineStipple = nouveauResetLineStipple;
nouveauInitTriFunctions(ctx);
_tnl_invalidate_vertex_state( ctx, ~0 );
_tnl_invalidate_vertices( ctx, ~0 );
@ -118,10 +110,10 @@ void nouveauFallback(struct nouveau_context *nmesa, GLuint bit, GLboolean mode)
void nouveauRunPipeline( GLcontext *ctx )
{
struct nouveau_context *vmesa = NOUVEAU_CONTEXT(ctx);
struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx);
if (vmesa->newState) {
vmesa->newRenderState |= vmesa->newState;
if (nmesa->newState) {
nmesa->newRenderState |= nmesa->newState;
}
_tnl_run_pipeline( ctx );

View file

@ -47,6 +47,9 @@ extern void nouveauFallback(struct nouveau_context *nmesa, GLuint bit, GLboolean
extern void nouveauRunPipeline( GLcontext *ctx );
extern void nouveauTriInitFunctions( GLcontext *ctx );
#endif /* __NOUVEAU_TRIS_H__ */

View file

@ -88,7 +88,7 @@ static inline void nv10StartPrimitive(struct nouveau_context* nmesa)
BEGIN_RING_PRIM(channel,NV20_BEGIN_VERTICES,NOUVEAU_MIN_PRIM_SIZE);
}
static inline void nv10FinishPrimitive(struct nouveau_context *nmesa)
inline void nv10FinishPrimitive(struct nouveau_context *nmesa)
{
FINISH_RING_PRIM();
if (nmesa->screen->card_type==NV_10)
@ -788,13 +788,11 @@ static void nv10RenderPrimitive( GLcontext *ctx, GLuint prim )
}
/**********************************************************************/
/* Initialization. */
/**********************************************************************/
void nouveauInitTriFuncs(GLcontext *ctx)
void nouveauTriInitFunctions(GLcontext *ctx)
{
struct nouveau_context *nmesa = NOUVEAU_CONTEXT(ctx);
TNLcontext *tnl = TNL_CONTEXT(ctx);
@ -821,3 +819,4 @@ void nouveauInitTriFuncs(GLcontext *ctx)
}

View file

@ -31,8 +31,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "mtypes.h"
extern void nv10TriInitFunctions( GLcontext *ctx );
extern void nv10Fallback( GLcontext *ctx, GLuint bit, GLboolean mode );
extern void nv10FinishPrimitive(struct nouveau_context *nmesa);
extern void nv10RenderStart(GLcontext *ctx);
#define FALLBACK( nmesa, bit, mode ) nouveauFallback( nmesa->glCtx, bit, mode )
#endif /* __NV10_SWTCL_H__ */