Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 5563 → Rev 5564

/contrib/sdk/sources/Mesa/mesa-10.6.0/src/gallium/targets/graw-null/SConscript
0,0 → 1,32
#######################################################################
# SConscript for xlib winsys
 
Import('*')
 
env = env.Clone()
 
graw_util = env.SharedObject(
source = ['graw_util.c'],
)
 
env = env.Clone()
 
sources = [
'graw_null.c',
graw_util,
]
 
env.Prepend(LIBS = [mesautil, gallium])
 
# TODO: write a wrapper function http://www.scons.org/wiki/WrapperFunctions
graw = env.SharedLibrary(
target = 'graw',
source = sources,
)
 
if env['platform'] == 'windows':
graw = env.FindIxes(graw, 'LIBPREFIX', 'LIBSUFFIX')
else:
graw = env.FindIxes(graw, 'SHLIBPREFIX', 'SHLIBSUFFIX')
 
Export('graw_util', 'graw')
/contrib/sdk/sources/Mesa/mesa-10.6.0/src/gallium/targets/graw-null/graw_null.c
0,0 → 1,28
#include "state_tracker/graw.h"
 
 
 
 
struct pipe_screen *
graw_create_window_and_screen( int x,
int y,
unsigned width,
unsigned height,
enum pipe_format format,
void **handle)
{
return NULL;
}
 
 
 
void
graw_set_display_func( void (*draw)( void ) )
{
}
 
 
void
graw_main_loop( void )
{
}
/contrib/sdk/sources/Mesa/mesa-10.6.0/src/gallium/targets/graw-null/graw_util.c
0,0 → 1,96
 
#include "pipe/p_compiler.h"
#include "pipe/p_context.h"
#include "pipe/p_shader_tokens.h"
#include "pipe/p_state.h"
#include "tgsi/tgsi_text.h"
#include "util/u_debug.h"
#include "util/u_memory.h"
#include "state_tracker/graw.h"
 
 
/* Helper functions. These are the same for all graw implementations.
*/
PUBLIC 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;
 
memset(&state, 0, sizeof state);
state.tokens = tokens;
return pipe->create_gs_state(pipe, &state);
}
 
PUBLIC 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;
 
memset(&state, 0, sizeof state);
state.tokens = tokens;
return pipe->create_vs_state(pipe, &state);
}
 
PUBLIC 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;
 
memset(&state, 0, sizeof state);
state.tokens = tokens;
return pipe->create_fs_state(pipe, &state);
}
 
static char out_filename[256] = "";
 
PUBLIC boolean
graw_parse_args(int *argi,
int argc,
char *argv[])
{
if (strcmp(argv[*argi], "-o") == 0) {
if (*argi + 1 >= argc) {
return FALSE;
}
 
strncpy(out_filename, argv[*argi + 1], sizeof(out_filename) - 1);
out_filename[sizeof(out_filename) - 1] = '\0';
*argi += 2;
return TRUE;
}
 
return FALSE;
}
 
PUBLIC boolean
graw_save_surface_to_file(struct pipe_context *pipe,
struct pipe_surface *surface,
const char *filename)
{
if (!filename || !*filename) {
filename = out_filename;
if (!filename || !*filename) {
return FALSE;
}
}
 
/* XXX: Make that working in release builds.
*/
debug_dump_surface_bmp(pipe, filename, surface);
return TRUE;
}