mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 09:18:04 +02:00
graw: split util code into new file
This commit is contained in:
parent
7375d7a5c9
commit
c267514470
3 changed files with 37 additions and 31 deletions
|
|
@ -25,6 +25,7 @@ env.Append(CPPPATH = [
|
|||
|
||||
sources = [
|
||||
'graw_xlib.c',
|
||||
'graw_util.c',
|
||||
]
|
||||
|
||||
if True:
|
||||
|
|
|
|||
36
src/gallium/targets/graw-xlib/graw_util.c
Normal file
36
src/gallium/targets/graw-xlib/graw_util.c
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
|
||||
#include "pipe/p_compiler.h"
|
||||
#include "pipe/p_context.h"
|
||||
#include "tgsi/tgsi_text.h"
|
||||
#include "util/u_memory.h"
|
||||
#include "state_tracker/graw.h"
|
||||
|
||||
|
||||
/* Helper functions. These are the same for all graw implementations.
|
||||
*/
|
||||
void *graw_parse_vertex_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_vs_state(pipe, &state);
|
||||
}
|
||||
|
||||
void *graw_parse_fragment_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_fs_state(pipe, &state);
|
||||
}
|
||||
|
||||
|
|
@ -2,7 +2,6 @@
|
|||
#include "pipe/p_context.h"
|
||||
#include "util/u_debug.h"
|
||||
#include "util/u_memory.h"
|
||||
#include "tgsi/tgsi_text.h"
|
||||
#include "target-helpers/wrap_screen.h"
|
||||
#include "state_tracker/xlib_sw_winsys.h"
|
||||
|
||||
|
|
@ -198,33 +197,3 @@ graw_main_loop( void )
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Helper functions. These are the same for all graw implementations.
|
||||
*/
|
||||
void *graw_parse_vertex_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_vs_state(pipe, &state);
|
||||
}
|
||||
|
||||
void *graw_parse_fragment_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_fs_state(pipe, &state);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue