summaryrefslogtreecommitdiff
path: root/src/gallium/include/pipe
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/include/pipe')
-rw-r--r--src/gallium/include/pipe/p_compiler.h2
-rw-r--r--src/gallium/include/pipe/p_config.h13
-rw-r--r--src/gallium/include/pipe/p_defines.h3
-rw-r--r--src/gallium/include/pipe/p_inlines.h30
-rw-r--r--src/gallium/include/pipe/p_screen.h2
-rw-r--r--src/gallium/include/pipe/p_shader_tokens.h81
-rw-r--r--src/gallium/include/pipe/p_state.h2
-rw-r--r--src/gallium/include/pipe/p_thread.h2
8 files changed, 96 insertions, 39 deletions
diff --git a/src/gallium/include/pipe/p_compiler.h b/src/gallium/include/pipe/p_compiler.h
index 4d64c74a4a..7bcebd3d6b 100644
--- a/src/gallium/include/pipe/p_compiler.h
+++ b/src/gallium/include/pipe/p_compiler.h
@@ -144,10 +144,12 @@ typedef unsigned char boolean;
#define ALIGN16_DECL(TYPE, NAME, SIZE) TYPE NAME##___aligned[SIZE] __attribute__(( aligned( 16 ) ))
#define ALIGN16_ASSIGN(NAME) NAME##___aligned
#define ALIGN16_ATTRIB __attribute__(( aligned( 16 ) ))
+#define ALIGN8_ATTRIB __attribute__(( aligned( 8 ) ))
#else
#define ALIGN16_DECL(TYPE, NAME, SIZE) TYPE NAME##___unaligned[SIZE + 1]
#define ALIGN16_ASSIGN(NAME) align16(NAME##___unaligned)
#define ALIGN16_ATTRIB
+#define ALIGN8_ATTRIB
#endif
diff --git a/src/gallium/include/pipe/p_config.h b/src/gallium/include/pipe/p_config.h
index af3746c026..05cbd2fc4d 100644
--- a/src/gallium/include/pipe/p_config.h
+++ b/src/gallium/include/pipe/p_config.h
@@ -85,8 +85,19 @@
#define PIPE_ARCH_X86_64
#endif
-#if 0 /* FIXME */
+#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
+#if defined(PIPE_CC_GCC) && !defined(__SSE2__)
+/* #warning SSE2 support requires -msse -msse2 compiler options */
+#else
+#define PIPE_ARCH_SSE
+#endif
+#endif
+
+#if defined(__PPC__)
#define PIPE_ARCH_PPC
+#if defined(__PPC64__)
+#define PIPE_ARCH_PPC_64
+#endif
#endif
diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
index dc8a92dccb..6bfac581f9 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -171,6 +171,8 @@ enum pipe_texture_target {
#define PIPE_TEXTURE_USAGE_PRIMARY 0x4 /* ie a frontbuffer */
#define PIPE_TEXTURE_USAGE_DEPTH_STENCIL 0x8
#define PIPE_TEXTURE_USAGE_SAMPLER 0x10
+/** Pipe driver custom usage flags should be greater or equal to this value */
+#define PIPE_TEXTURE_USAGE_CUSTOM (1 << 16)
#define PIPE_TEXTURE_GEOM_NON_SQUARE 0x1
#define PIPE_TEXTURE_GEOM_NON_POWER_OF_TWO 0x2
@@ -292,6 +294,7 @@ enum pipe_texture_target {
#define PIPE_CAP_GUARD_BAND_BOTTOM 23 /*< float */
#define PIPE_CAP_TEXTURE_MIRROR_CLAMP 24
#define PIPE_CAP_TEXTURE_MIRROR_REPEAT 25
+#define PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS 26
diff --git a/src/gallium/include/pipe/p_inlines.h b/src/gallium/include/pipe/p_inlines.h
index d70de8e301..5e79b7f485 100644
--- a/src/gallium/include/pipe/p_inlines.h
+++ b/src/gallium/include/pipe/p_inlines.h
@@ -82,11 +82,14 @@ static INLINE void
pipe_surface_reference(struct pipe_surface **ptr, struct pipe_surface *surf)
{
/* bump the refcount first */
- if (surf)
+ if (surf) {
+ assert(surf->refcount);
surf->refcount++;
+ }
if (*ptr) {
-
+ assert((*ptr)->refcount);
+
/* There are currently two sorts of surfaces... This needs to be
* fixed so that all surfaces are views into a texture.
*/
@@ -113,11 +116,16 @@ winsys_buffer_reference(struct pipe_winsys *winsys,
struct pipe_buffer **ptr,
struct pipe_buffer *buf)
{
- if (buf)
+ if (buf) {
+ assert(buf->refcount);
buf->refcount++;
+ }
- if (*ptr && --(*ptr)->refcount == 0)
- winsys->buffer_destroy( winsys, *ptr );
+ if (*ptr) {
+ assert((*ptr)->refcount);
+ if(--(*ptr)->refcount == 0)
+ winsys->buffer_destroy( winsys, *ptr );
+ }
*ptr = buf;
}
@@ -133,12 +141,15 @@ pipe_texture_reference(struct pipe_texture **ptr,
{
assert(ptr);
- if (pt)
+ if (pt) {
+ assert(pt->refcount);
pt->refcount++;
+ }
if (*ptr) {
struct pipe_screen *screen = (*ptr)->screen;
assert(screen);
+ assert((*ptr)->refcount);
screen->texture_release(screen, ptr);
assert(!*ptr);
@@ -154,6 +165,7 @@ pipe_texture_release(struct pipe_texture **ptr)
struct pipe_screen *screen;
assert(ptr);
screen = (*ptr)->screen;
+ assert((*ptr)->refcount);
screen->texture_release(screen, ptr);
*ptr = NULL;
}
@@ -176,12 +188,6 @@ pipe_user_buffer_create( struct pipe_screen *screen, void *ptr, unsigned size )
return screen->winsys->user_buffer_create(screen->winsys, ptr, size);
}
-static INLINE void
-pipe_buffer_destroy( struct pipe_screen *screen, struct pipe_buffer *buf )
-{
- screen->winsys->buffer_destroy(screen->winsys, buf);
-}
-
static INLINE void *
pipe_buffer_map(struct pipe_screen *screen,
struct pipe_buffer *buf,
diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h
index b15affef7a..3bedc75294 100644
--- a/src/gallium/include/pipe/p_screen.h
+++ b/src/gallium/include/pipe/p_screen.h
@@ -26,6 +26,8 @@
**************************************************************************/
/**
+ * @file
+ *
* Screen, Adapter or GPU
*
* These are driver functions/facilities that are context independent.
diff --git a/src/gallium/include/pipe/p_shader_tokens.h b/src/gallium/include/pipe/p_shader_tokens.h
index a562e3a6b1..ad43d799f3 100644
--- a/src/gallium/include/pipe/p_shader_tokens.h
+++ b/src/gallium/include/pipe/p_shader_tokens.h
@@ -1,4 +1,31 @@
-#if !defined TGSI_TOKEN_H
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#ifndef TGSI_TOKEN_H
#define TGSI_TOKEN_H
#ifdef __cplusplus
@@ -36,10 +63,10 @@ struct tgsi_processor
struct tgsi_token
{
- unsigned Type : 4; /* TGSI_TOKEN_TYPE_ */
- unsigned Size : 8; /* UINT */
+ unsigned Type : 4; /**< TGSI_TOKEN_TYPE_x */
+ unsigned Size : 8; /**< UINT */
unsigned Padding : 19;
- unsigned Extended : 1; /* BOOL */
+ unsigned Extended : 1; /**< BOOL */
};
enum tgsi_file_type {
@@ -79,20 +106,22 @@ enum tgsi_file_type {
struct tgsi_declaration
{
- unsigned Type : 4; /* TGSI_TOKEN_TYPE_DECLARATION */
- unsigned Size : 8; /* UINT */
- unsigned File : 4; /* one of TGSI_FILE_x */
- unsigned UsageMask : 4; /* bitmask of TGSI_WRITEMASK_x flags */
- unsigned Interpolate : 4; /* TGSI_INTERPOLATE_ */
- unsigned Semantic : 1; /* BOOL, any semantic info? */
- unsigned Padding : 6;
- unsigned Extended : 1; /* BOOL */
+ unsigned Type : 4; /**< TGSI_TOKEN_TYPE_DECLARATION */
+ unsigned Size : 8; /**< UINT */
+ unsigned File : 4; /**< one of TGSI_FILE_x */
+ unsigned UsageMask : 4; /**< bitmask of TGSI_WRITEMASK_x flags */
+ unsigned Interpolate : 4; /**< one of TGSI_INTERPOLATE_x */
+ unsigned Semantic : 1; /**< BOOL, any semantic info? */
+ unsigned Centroid : 1; /**< centroid sampling? */
+ unsigned Invariant : 1; /**< invariant optimization? */
+ unsigned Padding : 4;
+ unsigned Extended : 1; /**< BOOL */
};
struct tgsi_declaration_range
{
- unsigned First : 16; /* UINT */
- unsigned Last : 16; /* UINT */
+ unsigned First : 16; /**< UINT */
+ unsigned Last : 16; /**< UINT */
};
#define TGSI_SEMANTIC_POSITION 0
@@ -106,8 +135,8 @@ struct tgsi_declaration_range
struct tgsi_declaration_semantic
{
- unsigned SemanticName : 8; /* one of TGSI_SEMANTIC_ */
- unsigned SemanticIndex : 16; /* UINT */
+ unsigned SemanticName : 8; /**< one of TGSI_SEMANTIC_x */
+ unsigned SemanticIndex : 16; /**< UINT */
unsigned Padding : 8;
};
@@ -115,11 +144,11 @@ struct tgsi_declaration_semantic
struct tgsi_immediate
{
- unsigned Type : 4; /* TGSI_TOKEN_TYPE_IMMEDIATE */
- unsigned Size : 8; /* UINT */
- unsigned DataType : 4; /* TGSI_IMM_ */
+ unsigned Type : 4; /**< TGSI_TOKEN_TYPE_IMMEDIATE */
+ unsigned Size : 8; /**< UINT */
+ unsigned DataType : 4; /**< one of TGSI_IMM_x */
unsigned Padding : 15;
- unsigned Extended : 1; /* BOOL */
+ unsigned Extended : 1; /**< BOOL */
};
struct tgsi_immediate_float32
@@ -396,7 +425,7 @@ struct tgsi_immediate_float32
#define TGSI_SAT_ZERO_ONE 1 /* clamp to [0,1] */
#define TGSI_SAT_MINUS_PLUS_ONE 2 /* clamp to [-1,1] */
-/*
+/**
* Opcode is the operation code to execute. A given operation defines the
* semantics how the source registers (if any) are interpreted and what is
* written to the destination registers (if any) as a result of execution.
@@ -481,7 +510,7 @@ struct tgsi_instruction_ext
#define TGSI_SWIZZLE_Z 2
#define TGSI_SWIZZLE_W 3
-/*
+/**
* Precision controls the precision at which the operation should be executed.
*
* CondDstUpdate enables condition code register writes. When this field is
@@ -548,7 +577,7 @@ struct tgsi_instruction_ext_predicate
unsigned Extended : 1; /* BOOL */
};
-/*
+/**
* File specifies the register array to access.
*
* Index specifies the element number of a register in the register file.
@@ -580,7 +609,7 @@ struct tgsi_src_register
unsigned Extended : 1; /* BOOL */
};
-/*
+/**
* If tgsi_src_register::Extended is TRUE, tgsi_src_register_ext follows.
*
* Then, if tgsi_src_register::Indirect is TRUE, another tgsi_src_register
@@ -599,7 +628,7 @@ struct tgsi_src_register_ext
unsigned Extended : 1; /* BOOL */
};
-/*
+/**
* If tgsi_src_register_ext::Type is TGSI_SRC_REGISTER_EXT_TYPE_SWZ,
* it should be cast to tgsi_src_register_ext_swz.
*
@@ -617,7 +646,7 @@ struct tgsi_src_register_ext
#define TGSI_EXTSWIZZLE_ZERO 4
#define TGSI_EXTSWIZZLE_ONE 5
-/*
+/**
* ExtSwizzleX, ExtSwizzleY, ExtSwizzleZ and ExtSwizzleW swizzle the source
* register in an extended manner.
*
diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h
index da783389da..342f17260a 100644
--- a/src/gallium/include/pipe/p_state.h
+++ b/src/gallium/include/pipe/p_state.h
@@ -27,6 +27,8 @@
/**
+ * @file
+ *
* Abstract graphics pipe state objects.
*
* Basic notes:
diff --git a/src/gallium/include/pipe/p_thread.h b/src/gallium/include/pipe/p_thread.h
index e01d5a602b..8af3cd958b 100644
--- a/src/gallium/include/pipe/p_thread.h
+++ b/src/gallium/include/pipe/p_thread.h
@@ -25,6 +25,8 @@
/**
+ * @file
+ *
* Thread, mutex, condition var and thread-specific data functions.
*/