+static struct svga_shader_variant *
+translate_vertex_program(struct svga_context *svga,
+ const struct svga_vertex_shader *vs,
+ const struct svga_compile_key *key)
+{
+ if (svga_have_vgpu10(svga)) {
+ return svga_tgsi_vgpu10_translate(svga, &vs->base, key,
+ PIPE_SHADER_VERTEX);
+ }
+ else {
+ return svga_tgsi_vgpu9_translate(svga, &vs->base, key,
+ PIPE_SHADER_VERTEX);
+ }
+}
+
+
+/**
+ * Replace the given shader's instruction with a simple / dummy shader.
+ * We use this when normal shader translation fails.
+ */
+static struct svga_shader_variant *
+get_compiled_dummy_vertex_shader(struct svga_context *svga,
+ struct svga_vertex_shader *vs,
+ const struct svga_compile_key *key)
+{
+ const struct tgsi_token *dummy = get_dummy_vertex_shader();
+ struct svga_shader_variant *variant;
+
+ if (!dummy) {
+ return NULL;
+ }
+
+ FREE((void *) vs->base.tokens);
+ vs->base.tokens = dummy;
+
+ tgsi_scan_shader(vs->base.tokens, &vs->base.info);
+ vs->generic_outputs = svga_get_generic_outputs_mask(&vs->base.info);
+
+ variant = translate_vertex_program(svga, vs, key);
+ return variant;
+}
+
+