[Mesa-dev] [PATCH 1/2] st/mesa: set geometry shader to NULL when doing internal drawing
Jose Fonseca
jfonseca at vmware.com
Fri Nov 4 14:33:18 PDT 2011
----- Original Message -----
> The code expects the geometry shader to be NULL.
> We don't have geometry shaders now, but it's good to be prepared.
>
> v2: check for support in the cso context
> ---
> src/gallium/auxiliary/cso_cache/cso_context.c | 17
> ++++++++++++++++-
> src/gallium/auxiliary/util/u_blit.c | 6 ++++++
> src/gallium/auxiliary/util/u_gen_mipmap.c | 3 +++
> src/mesa/state_tracker/st_cb_bitmap.c | 5 +++++
> src/mesa/state_tracker/st_cb_clear.c | 3 +++
> src/mesa/state_tracker/st_cb_drawpixels.c | 4 ++++
> src/mesa/state_tracker/st_cb_drawtex.c | 3 +++
> src/mesa/state_tracker/st_extensions.c | 3 ++-
> 8 files changed, 42 insertions(+), 2 deletions(-)
>
Much nicer. Thanks Marek.
[...]
> @@ -785,7 +792,7 @@ void cso_restore_stencil_ref(struct cso_context
> *ctx)
> enum pipe_error cso_set_geometry_shader_handle(struct cso_context
> *ctx,
> void *handle)
> {
> - if (ctx->geometry_shader != handle) {
> + if (ctx->has_geometry_shader && ctx->geometry_shader != handle) {
In here it's better assert that when ctx->has_geometry_shader == FALSE, then handle must be NULL.
> ctx->geometry_shader = handle;
> ctx->pipe->bind_gs_state(ctx->pipe, handle);
> }
Otherwise looks great.
Jose
More information about the mesa-dev
mailing list