+/* the correct semantic to use for the texcoord varying depends on pipe-cap: */
+static enum tgsi_semantic
+texcoord_semantic(struct pipe_context *pctx)
+{
+ struct pipe_screen *pscreen = pctx->screen;
+
+ if (pscreen->get_param(pscreen, PIPE_CAP_TGSI_TEXCOORD)) {
+ return TGSI_SEMANTIC_TEXCOORD;
+ } else {
+ return TGSI_SEMANTIC_GENERIC;
+ }
+}
+
+static void *
+fd_prog_blit_vs(struct pipe_context *pctx)
+{
+ struct ureg_program *ureg;
+
+ ureg = ureg_create(PIPE_SHADER_VERTEX);
+ if (!ureg)
+ return NULL;
+
+ struct ureg_src in0 = ureg_DECL_vs_input(ureg, 0);
+ struct ureg_src in1 = ureg_DECL_vs_input(ureg, 1);
+
+ struct ureg_dst out0 = ureg_DECL_output(ureg, texcoord_semantic(pctx), 0);
+ struct ureg_dst out1 = ureg_DECL_output(ureg, TGSI_SEMANTIC_POSITION, 1);
+
+ ureg_MOV(ureg, out0, in0);
+ ureg_MOV(ureg, out1, in1);
+
+ ureg_END(ureg);
+
+ return ureg_create_shader_and_destroy(ureg, pctx);
+}
+