mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 09:28:07 +02:00
graw: add parse_geometry_shader helper
This commit is contained in:
parent
eb430046de
commit
9d343f4ba1
2 changed files with 16 additions and 0 deletions
|
|
@ -34,6 +34,9 @@ PUBLIC struct pipe_screen *graw_create_window_and_screen( int x,
|
|||
PUBLIC void graw_set_display_func( void (*func)( void ) );
|
||||
PUBLIC void graw_main_loop( void );
|
||||
|
||||
PUBLIC void *graw_parse_geometry_shader( struct pipe_context *pipe,
|
||||
const char *text );
|
||||
|
||||
PUBLIC void *graw_parse_vertex_shader( struct pipe_context *pipe,
|
||||
const char *text );
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,19 @@
|
|||
|
||||
/* Helper functions. These are the same for all graw implementations.
|
||||
*/
|
||||
void *graw_parse_geometry_shader(struct pipe_context *pipe,
|
||||
const char *text)
|
||||
{
|
||||
struct tgsi_token tokens[1024];
|
||||
struct pipe_shader_state state;
|
||||
|
||||
if (!tgsi_text_translate(text, tokens, Elements(tokens)))
|
||||
return NULL;
|
||||
|
||||
state.tokens = tokens;
|
||||
return pipe->create_gs_state(pipe, &state);
|
||||
}
|
||||
|
||||
void *graw_parse_vertex_shader(struct pipe_context *pipe,
|
||||
const char *text)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue