diff options
Diffstat (limited to 'src/gallium/include')
| -rw-r--r-- | src/gallium/include/pipe/p_compiler.h | 1 | ||||
| -rw-r--r-- | src/gallium/include/pipe/p_defines.h | 46 | ||||
| -rw-r--r-- | src/gallium/include/pipe/p_screen.h | 6 | ||||
| -rw-r--r-- | src/gallium/include/pipe/p_shader_tokens.h | 2 | ||||
| -rw-r--r-- | src/gallium/include/state_tracker/st_api.h | 79 |
5 files changed, 85 insertions, 49 deletions
diff --git a/src/gallium/include/pipe/p_compiler.h b/src/gallium/include/pipe/p_compiler.h index 0a5be43f6b..5020599591 100644 --- a/src/gallium/include/pipe/p_compiler.h +++ b/src/gallium/include/pipe/p_compiler.h @@ -35,6 +35,7 @@ #include <string.h> #include <stddef.h> #include <stdarg.h> +#include <limits.h> #if defined(_WIN32) && !defined(__WIN32__) diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index 627b5ae538..8b4663742f 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -449,16 +449,12 @@ enum pipe_cap { PIPE_CAP_TEXTURE_MIRROR_CLAMP, PIPE_CAP_TEXTURE_MIRROR_REPEAT, PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS, - PIPE_CAP_TGSI_CONT_SUPPORTED, PIPE_CAP_BLEND_EQUATION_SEPARATE, PIPE_CAP_SM3, /*< Shader Model, supported */ PIPE_CAP_STREAM_OUTPUT, - PIPE_CAP_MAX_PREDICATE_REGISTERS, /** Maximum texture image units accessible from vertex and fragment shaders * combined */ PIPE_CAP_MAX_COMBINED_SAMPLERS, - PIPE_CAP_MAX_CONST_BUFFERS, - PIPE_CAP_MAX_CONST_BUFFER_SIZE, /*< In bytes */ /** blend enables and write masks per rendertarget */ PIPE_CAP_INDEP_BLEND_ENABLE, /** different blend funcs per rendertarget */ @@ -468,35 +464,25 @@ enum pipe_cap { PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT, PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER, PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER, - - /* - * Shader limits. - */ - PIPE_CAP_MAX_FS_INSTRUCTIONS, - PIPE_CAP_MAX_FS_ALU_INSTRUCTIONS, - PIPE_CAP_MAX_FS_TEX_INSTRUCTIONS, - PIPE_CAP_MAX_FS_TEX_INDIRECTIONS, - PIPE_CAP_MAX_FS_CONTROL_FLOW_DEPTH, - PIPE_CAP_MAX_FS_INPUTS, - PIPE_CAP_MAX_FS_CONSTS, - PIPE_CAP_MAX_FS_TEMPS, - PIPE_CAP_MAX_FS_ADDRS, - PIPE_CAP_MAX_FS_PREDS, - PIPE_CAP_MAX_VS_INSTRUCTIONS, - PIPE_CAP_MAX_VS_ALU_INSTRUCTIONS, - PIPE_CAP_MAX_VS_TEX_INSTRUCTIONS, - PIPE_CAP_MAX_VS_TEX_INDIRECTIONS, - PIPE_CAP_MAX_VS_CONTROL_FLOW_DEPTH, - PIPE_CAP_MAX_VS_INPUTS, - PIPE_CAP_MAX_VS_CONSTS, - PIPE_CAP_MAX_VS_TEMPS, - PIPE_CAP_MAX_VS_ADDRS, - PIPE_CAP_MAX_VS_PREDS, - - PIPE_CAP_GEOMETRY_SHADER4, PIPE_CAP_DEPTH_CLAMP }; +/* Shader caps not specific to any single stage */ +enum pipe_shader_cap +{ + PIPE_SHADER_CAP_MAX_INSTRUCTIONS, /* if 0, it means the stage is unsupported */ + PIPE_SHADER_CAP_MAX_ALU_INSTRUCTIONS, + PIPE_SHADER_CAP_MAX_TEX_INSTRUCTIONS, + PIPE_SHADER_CAP_MAX_TEX_INDIRECTIONS, + PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH, + PIPE_SHADER_CAP_MAX_INPUTS, + PIPE_SHADER_CAP_MAX_CONSTS, + PIPE_SHADER_CAP_MAX_CONST_BUFFERS, + PIPE_SHADER_CAP_MAX_TEMPS, + PIPE_SHADER_CAP_MAX_ADDRS, + PIPE_SHADER_CAP_MAX_PREDS, + PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED, +}; /** * Referenced query flags. diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h index 21f428ed4a..912631242f 100644 --- a/src/gallium/include/pipe/p_screen.h +++ b/src/gallium/include/pipe/p_screen.h @@ -86,6 +86,12 @@ struct pipe_screen { */ float (*get_paramf)( struct pipe_screen *, enum pipe_cap param ); + /** + * Query a per-shader-stage integer-valued capability/parameter/limit + * \param param one of PIPE_CAP_x + */ + int (*get_shader_param)( struct pipe_screen *, unsigned shader, enum pipe_shader_cap param ); + struct pipe_context * (*context_create)( struct pipe_screen *, void *priv ); diff --git a/src/gallium/include/pipe/p_shader_tokens.h b/src/gallium/include/pipe/p_shader_tokens.h index c4bd17e92b..74488de17e 100644 --- a/src/gallium/include/pipe/p_shader_tokens.h +++ b/src/gallium/include/pipe/p_shader_tokens.h @@ -199,7 +199,7 @@ struct tgsi_property_data { * * For more information on semantics of opcodes and * which APIs are known to use which opcodes, see - * auxiliary/tgsi/tgsi-instruction-set.txt + * gallium/docs/source/tgsi.rst */ #define TGSI_OPCODE_ARL 0 #define TGSI_OPCODE_MOV 1 diff --git a/src/gallium/include/state_tracker/st_api.h b/src/gallium/include/state_tracker/st_api.h index 1142461188..8ea1554568 100644 --- a/src/gallium/include/state_tracker/st_api.h +++ b/src/gallium/include/state_tracker/st_api.h @@ -47,14 +47,29 @@ */ enum st_api_type { ST_API_OPENGL, - ST_API_OPENGL_ES1, - ST_API_OPENGL_ES2, ST_API_OPENVG, ST_API_COUNT }; /** + * The profile of a context. + */ +enum st_profile_type +{ + ST_PROFILE_DEFAULT, + ST_PROFILE_OPENGL_CORE, + ST_PROFILE_OPENGL_ES1, + ST_PROFILE_OPENGL_ES2 +}; + +/* for profile_mask in st_api */ +#define ST_PROFILE_DEFAULT_MASK (1 << ST_PROFILE_DEFAULT) +#define ST_PROFILE_OPENGL_CORE_MASK (1 << ST_PROFILE_OPENGL_CORE) +#define ST_PROFILE_OPENGL_ES1_MASK (1 << ST_PROFILE_OPENGL_ES1) +#define ST_PROFILE_OPENGL_ES2_MASK (1 << ST_PROFILE_OPENGL_ES2) + +/** * Used in st_context_iface->teximage. */ enum st_texture_type { @@ -180,6 +195,37 @@ struct st_visual }; /** + * Represent the attributes of a context. + */ +struct st_context_attribs +{ + /** + * The profile and minimal version to support. + * + * The valid profiles and versions are rendering API dependent. The latest + * version satisfying the request should be returned, unless + * forward_compatiible is true. + */ + enum st_profile_type profile; + int major, minor; + + /** + * Enable debugging. + */ + boolean debug; + + /** + * Return the exact version and disallow the use of deprecated features. + */ + boolean forward_compatible; + + /** + * The visual of the framebuffers the context will be bound to. + */ + struct st_visual visual; +}; + +/** * Represent a windowing system drawable. * * The framebuffer is implemented by the state tracker manager and @@ -357,6 +403,16 @@ struct st_manager struct st_api { /** + * The supported rendering API. + */ + enum st_api_type api; + + /** + * The supported profiles. Tested with ST_PROFILE_*_MASK. + */ + unsigned profile_mask; + + /** * Destroy the API. */ void (*destroy)(struct st_api *stapi); @@ -373,13 +429,14 @@ struct st_api */ struct st_context_iface *(*create_context)(struct st_api *stapi, struct st_manager *smapi, - const struct st_visual *visual, + const struct st_context_attribs *attribs, struct st_context_iface *stsharei); /** * Bind the context to the calling thread with draw and read as drawables. * - * The framebuffers might have different visuals than the context does. + * The framebuffers might be NULL, or might have different visuals than the + * context does. */ boolean (*make_current)(struct st_api *stapi, struct st_context_iface *stctxi, @@ -401,18 +458,4 @@ st_visual_have_buffers(const struct st_visual *visual, unsigned mask) return ((visual->buffer_mask & mask) == mask); } -/* these symbols may need to be dynamically lookup up */ -extern PUBLIC struct st_api * st_api_create_OpenGL(void); -extern PUBLIC struct st_api * st_api_create_OpenGL_ES1(void); -extern PUBLIC struct st_api * st_api_create_OpenGL_ES2(void); -extern PUBLIC struct st_api * st_api_create_OpenVG(void); - -/** - * The entry points of the state trackers. - */ -#define ST_CREATE_OPENGL_SYMBOL "st_api_create_OpenGL" -#define ST_CREATE_OPENGL_ES1_SYMBOL "st_api_create_OpenGL_ES1" -#define ST_CREATE_OPENGL_ES2_SYMBOL "st_api_create_OpenGL_ES2" -#define ST_CREATE_OPENVG_SYMBOL "st_api_create_OpenVG" - #endif /* _ST_API_H_ */ |
