svga_set_stream_output(struct svga_context *svga,
struct svga_stream_output *streamout)
{
- enum pipe_error ret = PIPE_OK;
unsigned id = streamout ? streamout->id : SVGA3D_INVALID_ID;
if (!svga_have_vgpu10(svga)) {
streamout, id);
if (svga->current_so != streamout) {
- /* Save current SO state */
- svga->current_so = streamout;
-
- ret = SVGA3D_vgpu10_SetStreamOutput(svga->swc, id);
+ enum pipe_error ret = SVGA3D_vgpu10_SetStreamOutput(svga->swc, id);
if (ret != PIPE_OK) {
- svga_context_flush(svga, NULL);
- ret = SVGA3D_vgpu10_SetStreamOutput(svga->swc, id);
+ return ret;
}
+
+ svga->current_so = streamout;
}
- return ret;
+ return PIPE_OK;
}
void
* it instead of the one from the vertex shader.
*/
if (svga_have_gs_streamout(svga)) {
- svga_set_stream_output(svga, gs->base.stream_output);
+ ret = svga_set_stream_output(svga, gs->base.stream_output);
+ if (ret != PIPE_OK) {
+ goto done;
+ }
}
else if (!svga_have_vs_streamout(svga)) {
/* turn off stream out */
- svga_set_stream_output(svga, NULL);
+ ret = svga_set_stream_output(svga, NULL);
+ if (ret != PIPE_OK) {
+ goto done;
+ }
}
/* SVGA_NEW_NEED_SWTNL */
/* No GS stream out */
if (svga_have_vs_streamout(svga)) {
/* Set VS stream out */
- svga_set_stream_output(svga, vs->base.stream_output);
+ ret = svga_set_stream_output(svga, vs->base.stream_output);
}
else {
/* turn off stream out */
- svga_set_stream_output(svga, NULL);
+ ret = svga_set_stream_output(svga, NULL);
+ }
+ if (ret != PIPE_OK) {
+ goto done;
}
}