tgsi/ureg: enable creating tessellation shaders with ureg_create_shader
authorMarek Olšák <marek.olsak@amd.com>
Mon, 18 May 2015 00:23:04 +0000 (02:23 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 26 May 2015 09:46:28 +0000 (11:46 +0200)
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/auxiliary/tgsi/tgsi_ureg.c

index 7a8bf5404e3dd800ea3d48de6c14026148d45cc9..037d31a1643710b90f0b411618c649cdeba69a4b 100644 (file)
@@ -1667,10 +1667,20 @@ void *ureg_create_shader( struct ureg_program *ureg,
    else
       memset(&state.stream_output, 0, sizeof(state.stream_output));
 
-   if (ureg->processor == TGSI_PROCESSOR_VERTEX)
-      return pipe->create_vs_state( pipe, &state );
-   else
-      return pipe->create_fs_state( pipe, &state );
+   switch (ureg->processor) {
+   case TGSI_PROCESSOR_VERTEX:
+      return pipe->create_vs_state(pipe, &state);
+   case TGSI_PROCESSOR_TESS_CTRL:
+      return pipe->create_tcs_state(pipe, &state);
+   case TGSI_PROCESSOR_TESS_EVAL:
+      return pipe->create_tes_state(pipe, &state);
+   case TGSI_PROCESSOR_GEOMETRY:
+      return pipe->create_gs_state(pipe, &state);
+   case TGSI_PROCESSOR_FRAGMENT:
+      return pipe->create_fs_state(pipe, &state);
+   default:
+      return NULL;
+   }
 }