svga->state.hw_draw.fs = NULL;
}
- ret = svga_destroy_shader_variant(svga, SVGA3D_SHADERTYPE_PS, variant);
- if (ret != PIPE_OK) {
- svga_context_flush(svga, NULL);
- ret = svga_destroy_shader_variant(svga, SVGA3D_SHADERTYPE_PS, variant);
- assert(ret == PIPE_OK);
- }
+ svga_destroy_shader_variant(svga, SVGA3D_SHADERTYPE_PS, variant);
}
FREE((void *)fs->base.tokens);
svga->state.hw_draw.gs = NULL;
}
- ret = svga_destroy_shader_variant(svga, SVGA3D_SHADERTYPE_GS, variant);
- if (ret != PIPE_OK) {
- svga_context_flush(svga, NULL);
- ret = svga_destroy_shader_variant(svga, SVGA3D_SHADERTYPE_GS,
- variant);
- assert(ret == PIPE_OK);
- }
+ svga_destroy_shader_variant(svga, SVGA3D_SHADERTYPE_GS, variant);
}
FREE((void *)gs->base.tokens);
svga->state.hw_draw.vs = NULL;
}
- ret = svga_destroy_shader_variant(svga, SVGA3D_SHADERTYPE_VS, variant);
- if (ret != PIPE_OK) {
- svga_context_flush(svga, NULL);
- ret = svga_destroy_shader_variant(svga, SVGA3D_SHADERTYPE_VS, variant);
- assert(ret == PIPE_OK);
- }
+ svga_destroy_shader_variant(svga, SVGA3D_SHADERTYPE_VS, variant);
}
FREE((void *)vs->base.tokens);
}
-enum pipe_error
+void
svga_destroy_shader_variant(struct svga_context *svga,
SVGA3dShaderType type,
struct svga_shader_variant *variant)
/* flush and try again */
svga_context_flush(svga, NULL);
ret = SVGA3D_vgpu10_DestroyShader(svga->swc, variant->id);
+ assert(ret == PIPE_OK);
}
util_bitmask_clear(svga->shader_id_bm, variant->id);
}
FREE(variant);
svga->hud.num_shaders--;
-
- return ret;
}
/*
struct svga_shader_variant *
svga_new_shader_variant(struct svga_context *svga);
-enum pipe_error
+void
svga_destroy_shader_variant(struct svga_context *svga,
SVGA3dShaderType type,
struct svga_shader_variant *variant);