aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga/svga_state_vs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/svga/svga_state_vs.c')
-rw-r--r--src/gallium/drivers/svga/svga_state_vs.c28
1 files changed, 10 insertions, 18 deletions
diff --git a/src/gallium/drivers/svga/svga_state_vs.c b/src/gallium/drivers/svga/svga_state_vs.c
index de41519593c..a846b779e70 100644
--- a/src/gallium/drivers/svga/svga_state_vs.c
+++ b/src/gallium/drivers/svga/svga_state_vs.c
@@ -127,13 +127,8 @@ compile_vs(struct svga_context *svga,
debug_printf("Failed to compile vertex shader,"
" using dummy shader instead.\n");
variant = get_compiled_dummy_vertex_shader(svga, vs, key);
- if (!variant) {
- ret = PIPE_ERROR;
- goto fail;
- }
}
-
- if (svga_shader_too_large(svga, variant)) {
+ else if (svga_shader_too_large(svga, variant)) {
/* too big, use dummy shader */
debug_printf("Shader too large (%u bytes),"
" using dummy shader instead.\n",
@@ -143,27 +138,24 @@ compile_vs(struct svga_context *svga,
svga_destroy_shader_variant(svga, SVGA3D_SHADERTYPE_VS, variant);
/* Use simple pass-through shader instead */
variant = get_compiled_dummy_vertex_shader(svga, vs, key);
- if (!variant) {
- ret = PIPE_ERROR;
- goto fail;
- }
+ }
+
+ if (!variant) {
+ return PIPE_ERROR;
}
ret = svga_define_shader(svga, SVGA3D_SHADERTYPE_VS, variant);
- if (ret != PIPE_OK)
- goto fail;
+ if (ret != PIPE_OK) {
+ svga_destroy_shader_variant(svga, SVGA3D_SHADERTYPE_VS, variant);
+ return ret;
+ }
*out_variant = variant;
return PIPE_OK;
-
-fail:
- if (variant) {
- svga_destroy_shader_variant(svga, SVGA3D_SHADERTYPE_VS, variant);
- }
- return ret;
}
+
/* SVGA_NEW_PRESCALE, SVGA_NEW_RAST, SVGA_NEW_FS
*/
static void