diff options
author | Eric Anholt <[email protected]> | 2018-03-20 11:09:02 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2018-03-21 10:04:21 -0700 |
commit | 024e814dee20a58f1d11129ffb2b4497beeacca7 (patch) | |
tree | f1fc9f3136e684ce8214c29fb9dbb0c675e56983 /src/gallium/drivers/vc5/vc5_emit.c | |
parent | f735ac6b1ce181015db3dde698c31580b92d4725 (diff) |
broadcom/vc5: Handle sparsely populated SO target array.
Fixes
GTF-GLES3.gtf.GL3Tests.transform_feedback.transform_feedback_state_variables
Diffstat (limited to 'src/gallium/drivers/vc5/vc5_emit.c')
-rw-r--r-- | src/gallium/drivers/vc5/vc5_emit.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/gallium/drivers/vc5/vc5_emit.c b/src/gallium/drivers/vc5/vc5_emit.c index ae47fda81ff..e5a9e0e03a2 100644 --- a/src/gallium/drivers/vc5/vc5_emit.c +++ b/src/gallium/drivers/vc5/vc5_emit.c @@ -597,10 +597,13 @@ v3dX(emit_state)(struct pipe_context *pctx) for (int i = 0; i < so->num_targets; i++) { const struct pipe_stream_output_target *target = so->targets[i]; - struct vc5_resource *rsc = - vc5_resource(target->buffer); + struct vc5_resource *rsc = target ? + vc5_resource(target->buffer) : NULL; #if V3D_VERSION >= 40 + if (!target) + continue; + cl_emit(&job->bcl, TRANSFORM_FEEDBACK_BUFFER, output) { output.buffer_address = cl_address(rsc->bo, @@ -611,13 +614,17 @@ v3dX(emit_state)(struct pipe_context *pctx) } #else /* V3D_VERSION < 40 */ cl_emit(&job->bcl, TRANSFORM_FEEDBACK_OUTPUT_ADDRESS, output) { - output.address = - cl_address(rsc->bo, - target->buffer_offset); + if (target) { + output.address = + cl_address(rsc->bo, + target->buffer_offset); + } }; #endif /* V3D_VERSION < 40 */ - vc5_job_add_write_resource(vc5->job, - target->buffer); + if (target) { + vc5_job_add_write_resource(vc5->job, + target->buffer); + } /* XXX: buffer_size? */ } } else { |