[Nouveau] [RFC] mesa/st: Avoid passing a NULL buffer to the drivers
Ilia Mirkin
imirkin at alum.mit.edu
Sat Jan 10 21:05:28 PST 2015
Can you elaborate a bit as to why that's the right thing to do?
On Wed, Jan 7, 2015 at 1:52 PM, Tobias Klausmann
<tobias.johannes.klausmann at mni.thm.de> wrote:
> If we capture transform feedback from n stream in (n-1) buffers we face a
> NULL buffer, use the buffer (n-1) to capture the output of stream n.
>
> This fixes one piglit test with nvc0:
> arb_gpu_shader5-xfb-streams-without-invocations
>
> Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann at mni.thm.de>
> ---
> src/mesa/state_tracker/st_cb_xformfb.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/src/mesa/state_tracker/st_cb_xformfb.c b/src/mesa/state_tracker/st_cb_xformfb.c
> index 8f75eda..5a12da4 100644
> --- a/src/mesa/state_tracker/st_cb_xformfb.c
> +++ b/src/mesa/state_tracker/st_cb_xformfb.c
> @@ -123,6 +123,11 @@ st_begin_transform_feedback(struct gl_context *ctx, GLenum mode,
> struct st_buffer_object *bo = st_buffer_object(sobj->base.Buffers[i]);
>
> if (bo) {
> + if (!bo->buffer)
> + /* If we capture transform feedback from n streams into (n-1)
> + * buffers we have to write to buffer (n-1) for stream n.
> + */
> + bo = st_buffer_object(sobj->base.Buffers[i-1]);
> /* Check whether we need to recreate the target. */
> if (!sobj->targets[i] ||
> sobj->targets[i] == sobj->draw_count ||
> --
> 2.2.1
>
> _______________________________________________
> Nouveau mailing list
> Nouveau at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/nouveau
More information about the Nouveau
mailing list