diff options
Diffstat (limited to 'src/gallium/include')
-rw-r--r-- | src/gallium/include/pipe/p_compiler.h | 30 | ||||
-rw-r--r-- | src/gallium/include/pipe/p_config.h | 10 | ||||
-rw-r--r-- | src/gallium/include/pipe/p_defines.h | 5 | ||||
-rw-r--r-- | src/gallium/include/pipe/p_state.h | 7 | ||||
-rw-r--r-- | src/gallium/include/state_tracker/drm_api.h | 57 | ||||
-rw-r--r-- | src/gallium/include/state_tracker/drm_driver.h | 71 | ||||
-rw-r--r-- | src/gallium/include/state_tracker/st_api.h | 6 |
7 files changed, 119 insertions, 67 deletions
diff --git a/src/gallium/include/pipe/p_compiler.h b/src/gallium/include/pipe/p_compiler.h index a14486a5fb5..0358c14e24b 100644 --- a/src/gallium/include/pipe/p_compiler.h +++ b/src/gallium/include/pipe/p_compiler.h @@ -60,6 +60,11 @@ #include <stdbool.h> +#ifdef __cplusplus +extern "C" { +#endif + + #if !defined(__HAIKU__) && !defined(__USE_MISC) typedef unsigned int uint; typedef unsigned short ushort; @@ -184,6 +189,25 @@ typedef unsigned char boolean; #endif + +#if defined(__GNUC__) + +#define PIPE_READ_WRITE_BARRIER() __asm__("":::"memory") + +#elif defined(_MSC_VER) + +void _ReadWriteBarrier(void); +#pragma intrinsic(_ReadWriteBarrier) +#define PIPE_READ_WRITE_BARRIER() _ReadWriteBarrier() + +#else + +#warning "Unsupported compiler" +#define PIPE_READ_WRITE_BARRIER() /* */ + +#endif + + /* You should use these macros to mark if blocks where the if condition * is either likely to be true, or unlikely to be true. * @@ -224,4 +248,10 @@ typedef unsigned char boolean; #define unlikely(x) !!(x) #endif + +#if defined(__cplusplus) +} +#endif + + #endif /* P_COMPILER_H */ diff --git a/src/gallium/include/pipe/p_config.h b/src/gallium/include/pipe/p_config.h index b81702a4fac..74a1fa29781 100644 --- a/src/gallium/include/pipe/p_config.h +++ b/src/gallium/include/pipe/p_config.h @@ -92,6 +92,11 @@ #else #define PIPE_ARCH_SSE #endif +#if defined(PIPE_CC_GCC) && !defined(__SSSE3__) +/* #warning SSE3 support requires -msse3 compiler options */ +#else +#define PIPE_ARCH_SSSE3 +#endif #endif #if defined(__PPC__) @@ -146,6 +151,11 @@ #define PIPE_OS_UNIX #endif +#if defined(__GNU__) +#define PIPE_OS_HURD +#define PIPE_OS_UNIX +#endif + #if defined(__sun) #define PIPE_OS_SOLARIS #define PIPE_OS_UNIX diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index 3b87d998ceb..00aa2076ed5 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -489,7 +489,10 @@ enum pipe_cap { PIPE_CAP_MAX_VS_CONSTS, PIPE_CAP_MAX_VS_TEMPS, PIPE_CAP_MAX_VS_ADDRS, - PIPE_CAP_MAX_VS_PREDS + PIPE_CAP_MAX_VS_PREDS, + + PIPE_CAP_GEOMETRY_SHADER4, + PIPE_CAP_DEPTH_CLAMP }; diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index 6231f06ec71..301fe2b74f0 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -61,8 +61,8 @@ extern "C" { #define PIPE_MAX_SAMPLERS 16 #define PIPE_MAX_VERTEX_SAMPLERS 16 #define PIPE_MAX_GEOMETRY_SAMPLERS 16 -#define PIPE_MAX_SHADER_INPUTS 16 -#define PIPE_MAX_SHADER_OUTPUTS 16 +#define PIPE_MAX_SHADER_INPUTS 32 +#define PIPE_MAX_SHADER_OUTPUTS 32 #define PIPE_MAX_TEXTURE_LEVELS 16 #define PIPE_MAX_SO_BUFFERS 4 @@ -155,6 +155,7 @@ struct pipe_clip_state { float ucp[PIPE_MAX_CLIP_PLANES][4]; unsigned nr; + unsigned depth_clamp:1; }; @@ -419,7 +420,7 @@ struct pipe_vertex_element /** Which vertex_buffer (as given to pipe->set_vertex_buffer()) does * this attribute live in? */ - unsigned vertex_buffer_index:8; + unsigned vertex_buffer_index; enum pipe_format src_format; }; diff --git a/src/gallium/include/state_tracker/drm_api.h b/src/gallium/include/state_tracker/drm_api.h deleted file mode 100644 index 4572c7e0423..00000000000 --- a/src/gallium/include/state_tracker/drm_api.h +++ /dev/null @@ -1,57 +0,0 @@ - -#ifndef _DRM_API_H_ -#define _DRM_API_H_ - -#include "pipe/p_compiler.h" - -struct pipe_screen; -struct pipe_winsys; -struct pipe_context; -struct pipe_resource; - -#define DRM_API_HANDLE_TYPE_SHARED 0 -#define DRM_API_HANDLE_TYPE_KMS 1 - -/** - * For use with pipe_screen::{texture_from_handle|texture_get_handle}. - */ -struct winsys_handle -{ - /** - * Unused for texture_from_handle, always - * DRM_API_HANDLE_TYPE_SHARED. Input to texture_get_handle, - * use TEXTURE_USAGE to select handle for kms or ipc. - */ - unsigned type; - /** - * Input to texture_from_handle. - * Output for texture_get_handle. - */ - unsigned handle; - /** - * Input to texture_from_handle. - * Output for texture_get_handle. - */ - unsigned stride; -}; - -struct drm_api -{ - void (*destroy)(struct drm_api *api); - - const char *name; - - /** - * Kernel driver name, as accepted by drmOpenByName. - */ - const char *driver_name; - - /** - * Create a pipe srcreen. - */ - struct pipe_screen* (*create_screen)(struct drm_api *api, int drm_fd); -}; - -extern struct drm_api * drm_api_create(void); - -#endif diff --git a/src/gallium/include/state_tracker/drm_driver.h b/src/gallium/include/state_tracker/drm_driver.h new file mode 100644 index 00000000000..d94c1e6a7cf --- /dev/null +++ b/src/gallium/include/state_tracker/drm_driver.h @@ -0,0 +1,71 @@ + +#ifndef _DRM_DRIVER_H_ +#define _DRM_DRIVER_H_ + +#include "pipe/p_compiler.h" + +struct pipe_screen; +struct pipe_winsys; +struct pipe_context; +struct pipe_resource; + +#define DRM_API_HANDLE_TYPE_SHARED 0 +#define DRM_API_HANDLE_TYPE_KMS 1 + +/** + * For use with pipe_screen::{texture_from_handle|texture_get_handle}. + */ +struct winsys_handle +{ + /** + * Unused for texture_from_handle, always + * DRM_API_HANDLE_TYPE_SHARED. Input to texture_get_handle, + * use TEXTURE_USAGE to select handle for kms or ipc. + */ + unsigned type; + /** + * Input to texture_from_handle. + * Output for texture_get_handle. + */ + unsigned handle; + /** + * Input to texture_from_handle. + * Output for texture_get_handle. + */ + unsigned stride; +}; + +struct drm_driver_descriptor +{ + /** + * Identifying sufix/prefix of the binary, used by egl. + */ + const char *name; + + /** + * Kernel driver name, as accepted by drmOpenByName. + */ + const char *driver_name; + + /** + * Create a pipe srcreen. + * + * This function does any wrapping of the screen. + * For example wrapping trace or rbug debugging drivers around it. + */ + struct pipe_screen* (*create_screen)(int drm_fd); +}; + +extern struct drm_driver_descriptor driver_descriptor; + +/** + * Instantiate a drm_driver_descriptor struct. + */ +#define DRM_DRIVER_DESCRIPTOR(name_str, driver_name_str, func) \ +struct drm_driver_descriptor driver_descriptor = { \ + .name = name_str, \ + .driver_name = driver_name_str, \ + .create_screen = func, \ +}; + +#endif diff --git a/src/gallium/include/state_tracker/st_api.h b/src/gallium/include/state_tracker/st_api.h index 621bdae5c85..11424611881 100644 --- a/src/gallium/include/state_tracker/st_api.h +++ b/src/gallium/include/state_tracker/st_api.h @@ -369,12 +369,6 @@ struct st_api st_proc_t (*get_proc_address)(struct st_api *stapi, const char *procname); /** - * Return true if the visual is supported by the state tracker. - */ - boolean (*is_visual_supported)(struct st_api *stapi, - const struct st_visual *visual); - - /** * Create a rendering context. */ struct st_context_iface *(*create_context)(struct st_api *stapi, |