First pass at updating these drivers with pipeline_stage struct changes.
This commit is contained in:
parent
963586b871
commit
bf87f86493
|
@ -209,31 +209,12 @@ static GLboolean gamma_run_render( GLcontext *ctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void gamma_check_render( GLcontext *ctx,
|
|
||||||
struct tnl_pipeline_stage *stage )
|
|
||||||
{
|
|
||||||
stage->inputs = TNL_CONTEXT(ctx)->render_inputs;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void dtr( struct tnl_pipeline_stage *stage )
|
|
||||||
{
|
|
||||||
(void)stage;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const struct tnl_pipeline_stage _gamma_render_stage =
|
const struct tnl_pipeline_stage _gamma_render_stage =
|
||||||
{
|
{
|
||||||
"gamma render",
|
"gamma render",
|
||||||
(_DD_NEW_SEPARATE_SPECULAR |
|
NULL,
|
||||||
_NEW_TEXTURE|
|
NULL,
|
||||||
_NEW_FOG|
|
NULL,
|
||||||
_NEW_RENDERMODE), /* re-check (new inputs) */
|
NULL,
|
||||||
0, /* re-run (always runs) */
|
|
||||||
GL_TRUE, /* active */
|
|
||||||
0, 0, /* inputs (set in check_render), outputs */
|
|
||||||
0, 0, /* changed_inputs, private */
|
|
||||||
dtr, /* destructor */
|
|
||||||
gamma_check_render, /* check - initially set to alloc data */
|
|
||||||
gamma_run_render /* run */
|
gamma_run_render /* run */
|
||||||
};
|
};
|
||||||
|
|
|
@ -161,31 +161,13 @@ static GLboolean i810_run_render( GLcontext *ctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void i810_check_render( GLcontext *ctx,
|
|
||||||
struct tnl_pipeline_stage *stage )
|
|
||||||
{
|
|
||||||
stage->inputs = TNL_CONTEXT(ctx)->render_inputs;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void dtr( struct tnl_pipeline_stage *stage )
|
|
||||||
{
|
|
||||||
(void)stage;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const struct tnl_pipeline_stage _i810_render_stage =
|
const struct tnl_pipeline_stage _i810_render_stage =
|
||||||
{
|
{
|
||||||
"i810 render",
|
"i810 render",
|
||||||
(_DD_NEW_SEPARATE_SPECULAR |
|
NULL,
|
||||||
_NEW_TEXTURE|
|
NULL,
|
||||||
_NEW_FOG|
|
NULL,
|
||||||
_NEW_RENDERMODE), /* re-check (new inputs) */
|
NULL,
|
||||||
0, /* re-run (always runs) */
|
|
||||||
GL_TRUE, /* active */
|
|
||||||
0, 0, /* inputs (set in check_render), outputs */
|
|
||||||
0, 0, /* changed_inputs, private */
|
|
||||||
dtr, /* destructor */
|
|
||||||
i810_check_render, /* check - initially set to alloc data */
|
|
||||||
i810_run_render /* run */
|
i810_run_render /* run */
|
||||||
};
|
};
|
||||||
|
|
|
@ -215,30 +215,12 @@ static GLboolean i830_run_render( GLcontext *ctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void i830_check_render( GLcontext *ctx,
|
|
||||||
struct tnl_pipeline_stage *stage )
|
|
||||||
{
|
|
||||||
stage->inputs = TNL_CONTEXT(ctx)->render_inputs;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void dtr( struct tnl_pipeline_stage *stage )
|
|
||||||
{
|
|
||||||
(void)stage;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const struct tnl_pipeline_stage _i830_render_stage =
|
const struct tnl_pipeline_stage _i830_render_stage =
|
||||||
{
|
{
|
||||||
"i830 render",
|
"i830 render",
|
||||||
(_DD_NEW_SEPARATE_SPECULAR |
|
NULL,
|
||||||
_NEW_TEXTURE|
|
NULL,
|
||||||
_NEW_FOG|
|
NULL,
|
||||||
_NEW_RENDERMODE), /* re-check (new inputs) */
|
NULL,
|
||||||
0, /* re-run (always runs) */
|
|
||||||
GL_TRUE, /* active */
|
|
||||||
0, 0, /* inputs (set in check_render), outputs */
|
|
||||||
0, 0, /* changed_inputs, private */
|
|
||||||
dtr, /* destructor */
|
|
||||||
i830_check_render, /* check - initially set to alloc data */
|
|
||||||
i830_run_render /* run */
|
i830_run_render /* run */
|
||||||
};
|
};
|
||||||
|
|
|
@ -229,31 +229,12 @@ static GLboolean intel_run_render( GLcontext *ctx,
|
||||||
return GL_FALSE; /* finished the pipe */
|
return GL_FALSE; /* finished the pipe */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void intel_check_render( GLcontext *ctx,
|
|
||||||
struct tnl_pipeline_stage *stage )
|
|
||||||
{
|
|
||||||
stage->inputs = TNL_CONTEXT(ctx)->render_inputs;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void dtr( struct tnl_pipeline_stage *stage )
|
|
||||||
{
|
|
||||||
(void)stage;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const struct tnl_pipeline_stage _intel_render_stage =
|
const struct tnl_pipeline_stage _intel_render_stage =
|
||||||
{
|
{
|
||||||
"intel render",
|
"intel render",
|
||||||
(_DD_NEW_SEPARATE_SPECULAR |
|
NULL,
|
||||||
_NEW_TEXTURE|
|
NULL,
|
||||||
_NEW_FOG|
|
NULL,
|
||||||
_NEW_RENDERMODE), /* re-check (new inputs) */
|
NULL,
|
||||||
0, /* re-run (always runs) */
|
|
||||||
GL_TRUE, /* active */
|
|
||||||
0, 0, /* inputs (set in check_render), outputs */
|
|
||||||
0, 0, /* changed_inputs, private */
|
|
||||||
dtr, /* destructor */
|
|
||||||
intel_check_render, /* check - initially set to alloc data */
|
|
||||||
intel_run_render /* run */
|
intel_run_render /* run */
|
||||||
};
|
};
|
||||||
|
|
|
@ -161,30 +161,12 @@ static GLboolean mga_run_render( GLcontext *ctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void mga_check_render( GLcontext *ctx, struct tnl_pipeline_stage *stage )
|
|
||||||
{
|
|
||||||
stage->inputs = TNL_CONTEXT(ctx)->render_inputs;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void dtr( struct tnl_pipeline_stage *stage )
|
|
||||||
{
|
|
||||||
(void)stage;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const struct tnl_pipeline_stage _mga_render_stage =
|
const struct tnl_pipeline_stage _mga_render_stage =
|
||||||
{
|
{
|
||||||
"mga render",
|
"mga render",
|
||||||
(_DD_NEW_SEPARATE_SPECULAR |
|
NULL,
|
||||||
_NEW_TEXTURE|
|
NULL,
|
||||||
_NEW_FOG|
|
NULL,
|
||||||
_NEW_RENDERMODE), /* re-check (new inputs) */
|
NULL,
|
||||||
0, /* re-run (always runs) */
|
|
||||||
GL_TRUE, /* active */
|
|
||||||
0, 0, /* inputs (set in check_render), outputs */
|
|
||||||
0, 0, /* changed_inputs, private */
|
|
||||||
dtr, /* destructor */
|
|
||||||
mga_check_render, /* check - initially set to alloc data */
|
|
||||||
mga_run_render /* run */
|
mga_run_render /* run */
|
||||||
};
|
};
|
||||||
|
|
|
@ -384,7 +384,7 @@ static GLboolean r200_run_tcl_render( GLcontext *ctx,
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
|
|
||||||
r200ReleaseArrays( ctx, ~0 /* stage->changed_inputs */ );
|
r200ReleaseArrays( ctx, ~0 /* stage->changed_inputs */ );
|
||||||
r200EmitArrays( ctx, stage->inputs );
|
r200EmitArrays( ctx, tnl->render_inputs );
|
||||||
|
|
||||||
rmesa->tcl.Elts = VB->Elts;
|
rmesa->tcl.Elts = VB->Elts;
|
||||||
|
|
||||||
|
@ -408,85 +408,15 @@ static GLboolean r200_run_tcl_render( GLcontext *ctx,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void r200_check_tcl_render( GLcontext *ctx,
|
|
||||||
struct tnl_pipeline_stage *stage )
|
|
||||||
{
|
|
||||||
r200ContextPtr rmesa = R200_CONTEXT(ctx);
|
|
||||||
GLuint inputs = VERT_BIT_POS;
|
|
||||||
GLuint unit;
|
|
||||||
|
|
||||||
/* Validate state:
|
|
||||||
*/
|
|
||||||
if (rmesa->NewGLState)
|
|
||||||
r200ValidateState( ctx );
|
|
||||||
|
|
||||||
if (ctx->RenderMode == GL_RENDER) {
|
|
||||||
/* Make all this event-driven:
|
|
||||||
*/
|
|
||||||
if (ctx->Light.Enabled) {
|
|
||||||
inputs |= VERT_BIT_NORMAL;
|
|
||||||
|
|
||||||
if (1 || ctx->Light.ColorMaterialEnabled) {
|
|
||||||
inputs |= VERT_BIT_COLOR0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
inputs |= VERT_BIT_COLOR0;
|
|
||||||
|
|
||||||
if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) {
|
|
||||||
inputs |= VERT_BIT_COLOR1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( ctx->Fog.FogCoordinateSource == GL_FOG_COORD ) {
|
|
||||||
inputs |= VERT_BIT_FOG;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (unit = 0 ; unit < ctx->Const.MaxTextureUnits; unit++) {
|
|
||||||
if (ctx->Texture.Unit[unit]._ReallyEnabled) {
|
|
||||||
if (rmesa->TexGenNeedNormals[unit]) {
|
|
||||||
inputs |= VERT_BIT_NORMAL;
|
|
||||||
}
|
|
||||||
inputs |= VERT_BIT_TEX(unit);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage->inputs = inputs;
|
|
||||||
stage->active = 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
stage->active = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void r200_init_tcl_render( GLcontext *ctx,
|
|
||||||
struct tnl_pipeline_stage *stage )
|
|
||||||
{
|
|
||||||
stage->check = r200_check_tcl_render;
|
|
||||||
stage->check( ctx, stage );
|
|
||||||
}
|
|
||||||
|
|
||||||
static void dtr( struct tnl_pipeline_stage *stage )
|
|
||||||
{
|
|
||||||
(void)stage;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Initial state for tcl stage.
|
/* Initial state for tcl stage.
|
||||||
*/
|
*/
|
||||||
const struct tnl_pipeline_stage _r200_tcl_stage =
|
const struct tnl_pipeline_stage _r200_tcl_stage =
|
||||||
{
|
{
|
||||||
"r200 render",
|
"r200 render",
|
||||||
(_DD_NEW_SEPARATE_SPECULAR |
|
NULL, /* private */
|
||||||
_NEW_LIGHT|
|
NULL,
|
||||||
_NEW_TEXTURE|
|
NULL,
|
||||||
_NEW_FOG|
|
NULL,
|
||||||
_NEW_RENDERMODE), /* re-check (new inputs) */
|
|
||||||
0, /* re-run (always runs) */
|
|
||||||
GL_TRUE, /* active */
|
|
||||||
0, 0, /* inputs (set in check_render), outputs */
|
|
||||||
0, NULL, /* changed_inputs, private */
|
|
||||||
dtr, /* destructor */
|
|
||||||
r200_init_tcl_render, /* check - initially set to alloc data */
|
|
||||||
r200_run_tcl_render /* run */
|
r200_run_tcl_render /* run */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -603,7 +603,7 @@ static GLboolean radeon_run_render( GLcontext *ctx,
|
||||||
tnl_render_func *tab = TAG(render_tab_verts);
|
tnl_render_func *tab = TAG(render_tab_verts);
|
||||||
GLuint i;
|
GLuint i;
|
||||||
|
|
||||||
if (rmesa->swtcl.indexed_verts.buf && (!VB->Elts || stage->changed_inputs))
|
if (rmesa->swtcl.indexed_verts.buf)
|
||||||
RELEASE_ELT_VERTS();
|
RELEASE_ELT_VERTS();
|
||||||
|
|
||||||
if (rmesa->swtcl.RenderIndex != 0 ||
|
if (rmesa->swtcl.RenderIndex != 0 ||
|
||||||
|
@ -646,32 +646,14 @@ static GLboolean radeon_run_render( GLcontext *ctx,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void radeon_check_render( GLcontext *ctx,
|
|
||||||
struct tnl_pipeline_stage *stage )
|
|
||||||
{
|
|
||||||
stage->inputs = TNL_CONTEXT(ctx)->render_inputs;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void dtr( struct tnl_pipeline_stage *stage )
|
|
||||||
{
|
|
||||||
(void)stage;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const struct tnl_pipeline_stage _radeon_render_stage =
|
const struct tnl_pipeline_stage _radeon_render_stage =
|
||||||
{
|
{
|
||||||
"radeon render",
|
"radeon render",
|
||||||
(_DD_NEW_SEPARATE_SPECULAR |
|
NULL,
|
||||||
_NEW_TEXTURE|
|
NULL,
|
||||||
_NEW_FOG|
|
NULL,
|
||||||
_NEW_RENDERMODE), /* re-check (new inputs) */
|
NULL,
|
||||||
0, /* re-run (always runs) */
|
|
||||||
GL_TRUE, /* active */
|
|
||||||
0, 0, /* inputs (set in check_render), outputs */
|
|
||||||
0, NULL, /* changed_inputs, private */
|
|
||||||
dtr, /* destructor */
|
|
||||||
radeon_check_render, /* check - initially set to alloc data */
|
|
||||||
radeon_run_render /* run */
|
radeon_run_render /* run */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -704,10 +686,7 @@ static GLboolean run_texrect_stage( GLcontext *ctx,
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
|
|
||||||
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) {
|
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) {
|
||||||
if (!(ctx->Texture.Unit[i]._ReallyEnabled & TEXTURE_RECT_BIT))
|
if (ctx->Texture.Unit[i]._ReallyEnabled & TEXTURE_RECT_BIT) {
|
||||||
continue;
|
|
||||||
|
|
||||||
if (stage->changed_inputs & VERT_BIT_TEX(i)) {
|
|
||||||
struct gl_texture_object *texObj = ctx->Texture.Unit[i].CurrentRect;
|
struct gl_texture_object *texObj = ctx->Texture.Unit[i].CurrentRect;
|
||||||
struct gl_texture_image *texImage = texObj->Image[0][texObj->BaseLevel];
|
struct gl_texture_image *texImage = texObj->Image[0][texObj->BaseLevel];
|
||||||
const GLfloat iw = 1.0/texImage->Width;
|
const GLfloat iw = 1.0/texImage->Width;
|
||||||
|
@ -722,9 +701,9 @@ static GLboolean run_texrect_stage( GLcontext *ctx,
|
||||||
out[j][1] = in[1] * ih;
|
out[j][1] = in[1] * ih;
|
||||||
in = (GLfloat *)((GLubyte *)in + instride);
|
in = (GLfloat *)((GLubyte *)in + instride);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
VB->TexCoordPtr[i] = &store->texcoord[i];
|
VB->TexCoordPtr[i] = &store->texcoord[i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
|
@ -748,30 +727,9 @@ static GLboolean alloc_texrect_data( GLcontext *ctx,
|
||||||
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
|
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
|
||||||
_mesa_vector4f_alloc( &store->texcoord[i], 0, VB->Size, 32 );
|
_mesa_vector4f_alloc( &store->texcoord[i], 0, VB->Size, 32 );
|
||||||
|
|
||||||
/* Now run the stage.
|
return GL_TRUE;
|
||||||
*/
|
|
||||||
stage->run = run_texrect_stage;
|
|
||||||
return stage->run( ctx, stage );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void check_texrect( GLcontext *ctx,
|
|
||||||
struct tnl_pipeline_stage *stage )
|
|
||||||
{
|
|
||||||
GLuint flags = 0;
|
|
||||||
|
|
||||||
if (ctx->Texture.Unit[0]._ReallyEnabled & TEXTURE_RECT_BIT)
|
|
||||||
flags |= VERT_BIT_TEX0;
|
|
||||||
|
|
||||||
if (ctx->Texture.Unit[1]._ReallyEnabled & TEXTURE_RECT_BIT)
|
|
||||||
flags |= VERT_BIT_TEX1;
|
|
||||||
|
|
||||||
stage->inputs = flags;
|
|
||||||
stage->outputs = flags;
|
|
||||||
stage->active = (flags != 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void free_texrect_data( struct tnl_pipeline_stage *stage )
|
static void free_texrect_data( struct tnl_pipeline_stage *stage )
|
||||||
{
|
{
|
||||||
struct texrect_stage_data *store = TEXRECT_STAGE_DATA(stage);
|
struct texrect_stage_data *store = TEXRECT_STAGE_DATA(stage);
|
||||||
|
@ -786,20 +744,14 @@ static void free_texrect_data( struct tnl_pipeline_stage *stage )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const struct tnl_pipeline_stage _radeon_texrect_stage =
|
const struct tnl_pipeline_stage _radeon_texrect_stage =
|
||||||
{
|
{
|
||||||
"radeon texrect stage", /* name */
|
"radeon texrect stage", /* name */
|
||||||
_NEW_TEXTURE, /* check_state */
|
NULL,
|
||||||
_NEW_TEXTURE, /* run_state */
|
alloc_texrect_data,
|
||||||
GL_TRUE, /* active? */
|
free_texrect_data,
|
||||||
0, /* inputs */
|
NULL,
|
||||||
0, /* outputs */
|
run_texrect_stage
|
||||||
0, /* changed_inputs */
|
|
||||||
NULL, /* private data */
|
|
||||||
free_texrect_data, /* destructor */
|
|
||||||
check_texrect, /* check */
|
|
||||||
alloc_texrect_data, /* run -- initially set to init */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -303,8 +303,8 @@ static GLboolean radeon_run_tcl_render( GLcontext *ctx,
|
||||||
if (VB->Count == 0)
|
if (VB->Count == 0)
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
|
|
||||||
radeonReleaseArrays( ctx, stage->changed_inputs );
|
radeonReleaseArrays( ctx, ~0 );
|
||||||
radeonEmitArrays( ctx, stage->inputs );
|
radeonEmitArrays( ctx, tnl->render_inputs );
|
||||||
|
|
||||||
rmesa->tcl.Elts = VB->Elts;
|
rmesa->tcl.Elts = VB->Elts;
|
||||||
|
|
||||||
|
@ -328,86 +328,15 @@ static GLboolean radeon_run_tcl_render( GLcontext *ctx,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void radeon_check_tcl_render( GLcontext *ctx,
|
|
||||||
struct tnl_pipeline_stage *stage )
|
|
||||||
{
|
|
||||||
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
|
|
||||||
GLuint inputs = VERT_BIT_POS;
|
|
||||||
|
|
||||||
if (ctx->RenderMode == GL_RENDER) {
|
|
||||||
/* Make all this event-driven:
|
|
||||||
*/
|
|
||||||
if (ctx->Light.Enabled) {
|
|
||||||
inputs |= VERT_BIT_NORMAL;
|
|
||||||
|
|
||||||
if (1 || ctx->Light.ColorMaterialEnabled) {
|
|
||||||
inputs |= VERT_BIT_COLOR0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
inputs |= VERT_BIT_COLOR0;
|
|
||||||
|
|
||||||
if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) {
|
|
||||||
inputs |= VERT_BIT_COLOR1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ctx->Texture.Unit[0]._ReallyEnabled) {
|
|
||||||
if (ctx->Texture.Unit[0].TexGenEnabled) {
|
|
||||||
if (rmesa->TexGenNeedNormals[0]) {
|
|
||||||
inputs |= VERT_BIT_NORMAL;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
inputs |= VERT_BIT_TEX0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ctx->Texture.Unit[1]._ReallyEnabled) {
|
|
||||||
if (ctx->Texture.Unit[1].TexGenEnabled) {
|
|
||||||
if (rmesa->TexGenNeedNormals[1]) {
|
|
||||||
inputs |= VERT_BIT_NORMAL;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
inputs |= VERT_BIT_TEX1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage->inputs = inputs;
|
|
||||||
stage->active = 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
stage->active = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void radeon_init_tcl_render( GLcontext *ctx,
|
|
||||||
struct tnl_pipeline_stage *stage )
|
|
||||||
{
|
|
||||||
stage->check = radeon_check_tcl_render;
|
|
||||||
stage->check( ctx, stage );
|
|
||||||
}
|
|
||||||
|
|
||||||
static void dtr( struct tnl_pipeline_stage *stage )
|
|
||||||
{
|
|
||||||
(void)stage;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Initial state for tcl stage.
|
/* Initial state for tcl stage.
|
||||||
*/
|
*/
|
||||||
const struct tnl_pipeline_stage _radeon_tcl_stage =
|
const struct tnl_pipeline_stage _radeon_tcl_stage =
|
||||||
{
|
{
|
||||||
"radeon render",
|
"radeon render",
|
||||||
(_DD_NEW_SEPARATE_SPECULAR |
|
NULL,
|
||||||
_NEW_LIGHT|
|
NULL,
|
||||||
_NEW_TEXTURE|
|
NULL,
|
||||||
_NEW_FOG|
|
NULL,
|
||||||
_NEW_RENDERMODE), /* re-check (new inputs) */
|
|
||||||
0, /* re-run (always runs) */
|
|
||||||
GL_TRUE, /* active */
|
|
||||||
0, 0, /* inputs (set in check_render), outputs */
|
|
||||||
0, NULL, /* changed_inputs, private */
|
|
||||||
dtr, /* destructor */
|
|
||||||
radeon_init_tcl_render, /* check - initially set to alloc data */
|
|
||||||
radeon_run_tcl_render /* run */
|
radeon_run_tcl_render /* run */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -191,62 +191,13 @@ static GLboolean s3v_run_render( GLcontext *ctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void s3v_check_render( GLcontext *ctx,
|
|
||||||
struct tnl_pipeline_stage *stage )
|
|
||||||
{
|
|
||||||
s3vContextPtr vmesa = S3V_CONTEXT(ctx);
|
|
||||||
GLuint inputs = VERT_BIT_POS | VERT_BIT_COLOR0;
|
|
||||||
|
|
||||||
DEBUG(("s3v_check_render\n"));
|
|
||||||
|
|
||||||
if (ctx->RenderMode == GL_RENDER) {
|
|
||||||
|
|
||||||
if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) {
|
|
||||||
DEBUG(("DD_SEPARATE_SPECULAR\n"));
|
|
||||||
inputs |= VERT_BIT_COLOR1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ctx->Texture.Unit[0]._ReallyEnabled) {
|
|
||||||
DEBUG(("ctx->Texture.Unit[0]._ReallyEnabled\n"));
|
|
||||||
inputs |= VERT_BIT_TEX(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ctx->Texture.Unit[1]._ReallyEnabled) {
|
|
||||||
DEBUG(("ctx->Texture.Unit[1]._ReallyEnabled\n"));
|
|
||||||
inputs |= VERT_BIT_TEX(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ctx->Fog.Enabled) {
|
|
||||||
DEBUG(("ctx->Fog.Enabled\n"));
|
|
||||||
inputs |= VERT_BIT_FOG;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage->inputs = inputs;
|
|
||||||
vmesa->SetupNewInputs = inputs;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void dtr( struct tnl_pipeline_stage *stage )
|
|
||||||
{
|
|
||||||
(void)stage;
|
|
||||||
/* hack to silence a compiler warning */
|
|
||||||
(void) &s3v_validate_render;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const struct tnl_pipeline_stage _s3v_render_stage =
|
const struct tnl_pipeline_stage _s3v_render_stage =
|
||||||
{
|
{
|
||||||
"s3v render",
|
"s3v render",
|
||||||
(_DD_NEW_SEPARATE_SPECULAR |
|
NULL,
|
||||||
_NEW_TEXTURE|
|
NULL,
|
||||||
_NEW_FOG|
|
NULL,
|
||||||
_NEW_RENDERMODE), /* re-check (new inputs) */
|
NULL,
|
||||||
0, /* re-run (always runs) */
|
|
||||||
GL_TRUE, /* active */
|
|
||||||
0, 0, /* inputs (set in check_render), outputs */
|
|
||||||
0, 0, /* changed_inputs, private */
|
|
||||||
dtr, /* destructor */
|
|
||||||
s3v_check_render, /* check - initially set to alloc data */
|
|
||||||
s3v_run_render /* run */
|
s3v_run_render /* run */
|
||||||
};
|
};
|
||||||
|
|
|
@ -151,7 +151,7 @@ static GLboolean savage_run_render( GLcontext *ctx,
|
||||||
GLboolean valid;
|
GLboolean valid;
|
||||||
GLuint i;
|
GLuint i;
|
||||||
|
|
||||||
if (savageHaveIndexedVerts(imesa) && (!VB->Elts || stage->changed_inputs))
|
if (savageHaveIndexedVerts(imesa))
|
||||||
savageReleaseIndexedVerts(imesa);
|
savageReleaseIndexedVerts(imesa);
|
||||||
|
|
||||||
if (imesa->savageScreen->chipset < S3_SAVAGE4 &&
|
if (imesa->savageScreen->chipset < S3_SAVAGE4 &&
|
||||||
|
@ -211,31 +211,13 @@ static GLboolean savage_run_render( GLcontext *ctx,
|
||||||
return GL_FALSE; /* finished the pipe */
|
return GL_FALSE; /* finished the pipe */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void savage_check_render( GLcontext *ctx,
|
|
||||||
struct tnl_pipeline_stage *stage )
|
|
||||||
{
|
|
||||||
stage->inputs = TNL_CONTEXT(ctx)->render_inputs;
|
|
||||||
stage->active = SAVAGE_CONTEXT(ctx)->enable_fastpath;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void dtr( struct tnl_pipeline_stage *stage )
|
|
||||||
{
|
|
||||||
(void)stage;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct tnl_pipeline_stage _savage_render_stage =
|
struct tnl_pipeline_stage _savage_render_stage =
|
||||||
{
|
{
|
||||||
"savage render",
|
"savage render",
|
||||||
(_DD_NEW_SEPARATE_SPECULAR |
|
NULL,
|
||||||
_NEW_TEXTURE|
|
NULL,
|
||||||
_NEW_FOG|
|
NULL,
|
||||||
_NEW_RENDERMODE), /* re-check (new inputs) */
|
NULL,
|
||||||
0, /* re-run (always runs) */
|
|
||||||
GL_TRUE, /* active */
|
|
||||||
0, 0, /* inputs (set in check_render), outputs */
|
|
||||||
0, 0, /* changed_inputs, private */
|
|
||||||
dtr, /* destructor */
|
|
||||||
savage_check_render, /* check - initially set to alloc data */
|
|
||||||
savage_run_render /* run */
|
savage_run_render /* run */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -244,6 +226,7 @@ struct tnl_pipeline_stage _savage_render_stage =
|
||||||
/* Pipeline stage for texture coordinate normalization */
|
/* Pipeline stage for texture coordinate normalization */
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
struct texnorm_stage_data {
|
struct texnorm_stage_data {
|
||||||
|
GLboolean active;
|
||||||
GLvector4f texcoord[MAX_TEXTURE_UNITS];
|
GLvector4f texcoord[MAX_TEXTURE_UNITS];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -259,12 +242,11 @@ static GLboolean run_texnorm_stage( GLcontext *ctx,
|
||||||
struct vertex_buffer *VB = &tnl->vb;
|
struct vertex_buffer *VB = &tnl->vb;
|
||||||
GLuint i;
|
GLuint i;
|
||||||
|
|
||||||
if (imesa->Fallback)
|
if (imesa->Fallback || !store->active)
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
|
|
||||||
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) {
|
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) {
|
||||||
if (!(stage->inputs & stage->changed_inputs & VERT_BIT_TEX(i)) ||
|
if (VB->TexCoordPtr[i]->size == 4)
|
||||||
VB->TexCoordPtr[i]->size == 4)
|
|
||||||
/* Never try to normalize homogenous tex coords! */
|
/* Never try to normalize homogenous tex coords! */
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -335,16 +317,14 @@ static GLboolean alloc_texnorm_data( GLcontext *ctx,
|
||||||
|
|
||||||
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
|
for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
|
||||||
_mesa_vector4f_alloc( &store->texcoord[i], 0, VB->Size, 32 );
|
_mesa_vector4f_alloc( &store->texcoord[i], 0, VB->Size, 32 );
|
||||||
|
|
||||||
/* Now run the stage.
|
return GL_TRUE;
|
||||||
*/
|
|
||||||
stage->run = run_texnorm_stage;
|
|
||||||
return stage->run( ctx, stage );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void check_texnorm( GLcontext *ctx,
|
static void validate_texnorm( GLcontext *ctx,
|
||||||
struct tnl_pipeline_stage *stage )
|
struct tnl_pipeline_stage *stage )
|
||||||
{
|
{
|
||||||
|
struct texnorm_stage_data *store = TEXNORM_STAGE_DATA(stage);
|
||||||
GLuint flags = 0;
|
GLuint flags = 0;
|
||||||
|
|
||||||
if (((ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) &&
|
if (((ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) &&
|
||||||
|
@ -359,9 +339,7 @@ static void check_texnorm( GLcontext *ctx,
|
||||||
(ctx->Texture.Unit[1]._Current->WrapT == GL_REPEAT)))
|
(ctx->Texture.Unit[1]._Current->WrapT == GL_REPEAT)))
|
||||||
flags |= VERT_BIT_TEX1;
|
flags |= VERT_BIT_TEX1;
|
||||||
|
|
||||||
stage->inputs = flags;
|
store->active = (flags != 0);
|
||||||
stage->outputs = flags;
|
|
||||||
stage->active = (flags != 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void free_texnorm_data( struct tnl_pipeline_stage *stage )
|
static void free_texnorm_data( struct tnl_pipeline_stage *stage )
|
||||||
|
@ -381,14 +359,9 @@ static void free_texnorm_data( struct tnl_pipeline_stage *stage )
|
||||||
struct tnl_pipeline_stage _savage_texnorm_stage =
|
struct tnl_pipeline_stage _savage_texnorm_stage =
|
||||||
{
|
{
|
||||||
"savage texture coordinate normalization stage", /* name */
|
"savage texture coordinate normalization stage", /* name */
|
||||||
_NEW_TEXTURE, /* check_state */
|
|
||||||
_NEW_TEXTURE, /* run_state */
|
|
||||||
GL_TRUE, /* active? */
|
|
||||||
0, /* inputs */
|
|
||||||
0, /* outputs */
|
|
||||||
0, /* changed_inputs */
|
|
||||||
NULL, /* private data */
|
NULL, /* private data */
|
||||||
free_texnorm_data, /* destructor */
|
|
||||||
check_texnorm, /* check */
|
|
||||||
alloc_texnorm_data, /* run -- initially set to init */
|
alloc_texnorm_data, /* run -- initially set to init */
|
||||||
|
free_texnorm_data, /* destructor */
|
||||||
|
validate_texnorm,
|
||||||
|
run_texnorm_stage
|
||||||
};
|
};
|
||||||
|
|
|
@ -118,33 +118,13 @@ static GLboolean via_run_fastrender(GLcontext *ctx,
|
||||||
return GL_FALSE; /* finished the pipe */
|
return GL_FALSE; /* finished the pipe */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void via_check_fastrender(GLcontext *ctx,
|
|
||||||
struct tnl_pipeline_stage *stage)
|
|
||||||
{
|
|
||||||
stage->inputs = TNL_CONTEXT(ctx)->render_inputs;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void fastdtr(struct tnl_pipeline_stage *stage)
|
|
||||||
{
|
|
||||||
(void)stage;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const struct tnl_pipeline_stage _via_fastrender_stage =
|
const struct tnl_pipeline_stage _via_fastrender_stage =
|
||||||
{
|
{
|
||||||
"via fast render",
|
"via fast render",
|
||||||
(_DD_NEW_SEPARATE_SPECULAR |
|
NULL,
|
||||||
_NEW_TEXTURE|
|
NULL,
|
||||||
_NEW_FOG|
|
NULL,
|
||||||
_NEW_RENDERMODE), /* re-check (new inputs) */
|
NULL,
|
||||||
0, /* re-run (always runs) */
|
|
||||||
GL_TRUE, /* active */
|
|
||||||
0, 0, /* inputs (set in check_render), outputs */
|
|
||||||
0, 0, /* changed_inputs, private */
|
|
||||||
fastdtr, /* destructor */
|
|
||||||
via_check_fastrender, /* check - initially set to alloc data */
|
|
||||||
via_run_fastrender /* run */
|
via_run_fastrender /* run */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue