Path: blob/21.2-virgl/src/gallium/include/frontend/graw.h
4565 views
/**************************************************************************1*2* Copyright 2010 VMware, Inc.3* All Rights Reserved.4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the7* "Software"), to deal in the Software without restriction, including8* without limitation the rights to use, copy, modify, merge, publish,9* distribute, sub license, and/or sell copies of the Software, and to10* permit persons to whom the Software is furnished to do so, subject to11* the following conditions:12*13* The above copyright notice and this permission notice (including the14* next paragraph) shall be included in all copies or substantial portions15* of the Software.16*17* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS18* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF19* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.20* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR21* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,22* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE23* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.24*25**************************************************************************/2627#ifndef GALLIUM_RAW_H28#define GALLIUM_RAW_H2930/* This is an API for exercising gallium functionality in a31* platform-neutral fashion. Whatever platform integration is32* necessary to implement this interface is orchestrated by the33* individual target building this entity.34*35* For instance, the graw-xlib target includes code to implement these36* interfaces on top of the X window system.37*38* Programs using this interface may additionally benefit from some of39* the utilities currently in the libgallium.a library, especially40* those for parsing text representations of TGSI shaders.41*/4243#include "pipe/p_compiler.h"44#include "pipe/p_format.h"4546struct pipe_context;47struct pipe_screen;48struct pipe_surface;4950/* Returns a handle to be used with flush_frontbuffer()/present().51*52* Query format support with screen::is_format_supported and usage53* XXX.54*/55PUBLIC struct pipe_screen *graw_create_window_and_screen( int x,56int y,57unsigned width,58unsigned height,59enum pipe_format format,60void **handle);6162PUBLIC void graw_set_display_func( void (*func)( void ) );63PUBLIC void graw_main_loop( void );6465PUBLIC void *graw_parse_geometry_shader( struct pipe_context *pipe,66const char *text );6768PUBLIC void *graw_parse_vertex_shader( struct pipe_context *pipe,69const char *text );7071PUBLIC void *graw_parse_fragment_shader( struct pipe_context *pipe,72const char *text );7374/* Parse a single command-line option, if any. Options include:75*76* -o <filename>77*78* If an option has been successfully parsed, argi is updated79* to point just after the option and return TRUE.80*/81PUBLIC bool graw_parse_args(int *argi, int argc, char *argv[]);8283/* Saves surface contents to a file.84*85* If filename is NULL, the filename provided with the `-o' option86* is used. If the option has not been specified, the surface87* will not be saved.88*89* Returns TRUE if the surface has been saved.90*/91PUBLIC bool graw_save_surface_to_file(struct pipe_context *pipe,92struct pipe_surface *surface,93const char *filename);9495#endif969798