mesa: initial support for ARB_geometry_shader4
laying down the foundation for everything and implementing most of the stuff. linking, gl_VerticesIn and multidimensional inputs are left.
This commit is contained in:
@@ -66,7 +66,19 @@ translate_fp(struct st_context *st,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Translate geometry program if needed.
|
||||
*/
|
||||
static void
|
||||
translate_gp(struct st_context *st,
|
||||
struct st_geometry_program *stgp)
|
||||
{
|
||||
if (!stgp->tgsi.tokens) {
|
||||
assert(stgp->Base.Base.NumInstructions > 1);
|
||||
|
||||
st_translate_geometry_program(st, stgp);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find a translated vertex program that corresponds to stvp and
|
||||
@@ -222,3 +234,33 @@ const struct st_tracked_state st_update_vp = {
|
||||
},
|
||||
update_vp /* update */
|
||||
};
|
||||
|
||||
static void
|
||||
update_gp( struct st_context *st )
|
||||
{
|
||||
|
||||
struct st_geometry_program *stgp;
|
||||
|
||||
if (!st->ctx->GeometryProgram._Current) {
|
||||
cso_set_geometry_shader_handle(st->cso_context, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
stgp = st_geometry_program(st->ctx->GeometryProgram._Current);
|
||||
assert(stgp->Base.Base.Target == MESA_GEOMETRY_PROGRAM);
|
||||
|
||||
translate_gp(st, stgp);
|
||||
|
||||
st_reference_geomprog(st, &st->gp, stgp);
|
||||
|
||||
cso_set_geometry_shader_handle(st->cso_context, stgp->driver_shader);
|
||||
}
|
||||
|
||||
const struct st_tracked_state st_update_gp = {
|
||||
"st_update_gp", /* name */
|
||||
{ /* dirty */
|
||||
0, /* mesa */
|
||||
ST_NEW_GEOMETRY_PROGRAM /* st */
|
||||
},
|
||||
update_gp /* update */
|
||||
};
|
||||
|
Reference in New Issue
Block a user