2 #include "pipe/p_compiler.h"
3 #include "pipe/p_context.h"
4 #include "tgsi/tgsi_text.h"
5 #include "util/u_memory.h"
6 #include "state_tracker/graw.h"
9 /* Helper functions. These are the same for all graw implementations.
11 void *graw_parse_geometry_shader(struct pipe_context
*pipe
,
14 struct tgsi_token tokens
[1024];
15 struct pipe_shader_state state
;
17 if (!tgsi_text_translate(text
, tokens
, Elements(tokens
)))
20 state
.tokens
= tokens
;
21 return pipe
->create_gs_state(pipe
, &state
);
24 void *graw_parse_vertex_shader(struct pipe_context
*pipe
,
27 struct tgsi_token tokens
[1024];
28 struct pipe_shader_state state
;
30 if (!tgsi_text_translate(text
, tokens
, Elements(tokens
)))
33 state
.tokens
= tokens
;
34 return pipe
->create_vs_state(pipe
, &state
);
37 void *graw_parse_fragment_shader(struct pipe_context
*pipe
,
40 struct tgsi_token tokens
[1024];
41 struct pipe_shader_state state
;
43 if (!tgsi_text_translate(text
, tokens
, Elements(tokens
)))
46 state
.tokens
= tokens
;
47 return pipe
->create_fs_state(pipe
, &state
);