svga: replace gotos with else clauses
authorBrian Paul <brianp@vmware.com>
Thu, 15 Feb 2018 16:12:03 +0000 (09:12 -0700)
committerBrian Paul <brianp@vmware.com>
Thu, 15 Feb 2018 16:49:06 +0000 (09:49 -0700)
Simple clean-up.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
src/gallium/drivers/svga/svga_state_fs.c
src/gallium/drivers/svga/svga_state_gs.c
src/gallium/drivers/svga/svga_state_vs.c

index eeb1ba60f6553534d818a810728ffe6f9a0df02e..5190542d0276e8379db3b687db89674796a7d47c 100644 (file)
@@ -383,18 +383,17 @@ svga_reemit_fs_bindings(struct svga_context *svga)
       ret =  svga->swc->resource_rebind(svga->swc, NULL,
                                         svga->state.hw_draw.fs->gb_shader,
                                         SVGA_RELOC_READ);
-      goto out;
+   }
+   else {
+      if (svga_have_vgpu10(svga))
+         ret = SVGA3D_vgpu10_SetShader(svga->swc, SVGA3D_SHADERTYPE_PS,
+                                       svga->state.hw_draw.fs->gb_shader,
+                                       svga->state.hw_draw.fs->id);
+      else
+         ret = SVGA3D_SetGBShader(svga->swc, SVGA3D_SHADERTYPE_PS,
+                                  svga->state.hw_draw.fs->gb_shader);
    }
 
-   if (svga_have_vgpu10(svga))
-      ret = SVGA3D_vgpu10_SetShader(svga->swc, SVGA3D_SHADERTYPE_PS,
-                                    svga->state.hw_draw.fs->gb_shader,
-                                    svga->state.hw_draw.fs->id);
-   else
-      ret = SVGA3D_SetGBShader(svga->swc, SVGA3D_SHADERTYPE_PS,
-                               svga->state.hw_draw.fs->gb_shader);
-
- out:
    if (ret != PIPE_OK)
       return ret;
 
index 19f0887d2ba6cb3273c178c651eebc1f42c49c66..38d85f0325cd33607768fb4ea0a2314a5885ec43 100644 (file)
@@ -153,13 +153,12 @@ svga_reemit_gs_bindings(struct svga_context *svga)
    if (!svga_need_to_rebind_resources(svga)) {
       ret =  svga->swc->resource_rebind(svga->swc, NULL, gbshader,
                                         SVGA_RELOC_READ);
-      goto out;
+   }
+   else {
+      ret = SVGA3D_vgpu10_SetShader(svga->swc, SVGA3D_SHADERTYPE_GS,
+                                    gbshader, shaderId);
    }
 
-   ret = SVGA3D_vgpu10_SetShader(svga->swc, SVGA3D_SHADERTYPE_GS,
-                                 gbshader, shaderId);
-
- out:
    if (ret != PIPE_OK)
       return ret;
 
index 3dfc9f451c918d1a8fb2dc14f04ed96092d3a68b..ad93f60048aa690b8de8e6b245e3d2df8c84cd48 100644 (file)
@@ -227,16 +227,15 @@ svga_reemit_vs_bindings(struct svga_context *svga)
    if (!svga_need_to_rebind_resources(svga)) {
       ret =  svga->swc->resource_rebind(svga->swc, NULL, gbshader,
                                         SVGA_RELOC_READ);
-      goto out;
+   }
+   else {
+      if (svga_have_vgpu10(svga))
+         ret = SVGA3D_vgpu10_SetShader(svga->swc, SVGA3D_SHADERTYPE_VS,
+                                       gbshader, shaderId);
+      else
+         ret = SVGA3D_SetGBShader(svga->swc, SVGA3D_SHADERTYPE_VS, gbshader);
    }
 
-   if (svga_have_vgpu10(svga))
-      ret = SVGA3D_vgpu10_SetShader(svga->swc, SVGA3D_SHADERTYPE_VS,
-                                    gbshader, shaderId);
-   else
-      ret = SVGA3D_SetGBShader(svga->swc, SVGA3D_SHADERTYPE_VS, gbshader);
-
- out:
    if (ret != PIPE_OK)
       return ret;