tgsi_util.h

Go to the documentation of this file.
00001 /**************************************************************************
00002  * 
00003  * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
00004  * All Rights Reserved.
00005  * 
00006  * Permission is hereby granted, free of charge, to any person obtaining a
00007  * copy of this software and associated documentation files (the
00008  * "Software"), to deal in the Software without restriction, including
00009  * without limitation the rights to use, copy, modify, merge, publish,
00010  * distribute, sub license, and/or sell copies of the Software, and to
00011  * permit persons to whom the Software is furnished to do so, subject to
00012  * the following conditions:
00013  * 
00014  * The above copyright notice and this permission notice (including the
00015  * next paragraph) shall be included in all copies or substantial portions
00016  * of the Software.
00017  * 
00018  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00019  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00020  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
00021  * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
00022  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
00023  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
00024  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00025  * 
00026  **************************************************************************/
00027 
00028 #ifndef TGSI_UTIL_H
00029 #define TGSI_UTIL_H
00030 
00031 #if defined __cplusplus
00032 extern "C" {
00033 #endif
00034 
00035 struct tgsi_src_register;
00036 struct tgsi_src_register_ext_swz;
00037 struct tgsi_full_src_register;
00038 
00039 void *
00040 tgsi_align_128bit(
00041    void *unaligned );
00042 
00043 unsigned
00044 tgsi_util_get_src_register_swizzle(
00045    const struct tgsi_src_register *reg,
00046    unsigned component );
00047 
00048 unsigned
00049 tgsi_util_get_src_register_extswizzle(
00050    const struct tgsi_src_register_ext_swz *reg,
00051    unsigned component);
00052 
00053 unsigned
00054 tgsi_util_get_full_src_register_extswizzle(
00055    const struct tgsi_full_src_register *reg,
00056    unsigned component );
00057 
00058 void
00059 tgsi_util_set_src_register_swizzle(
00060    struct tgsi_src_register *reg,
00061    unsigned swizzle,
00062    unsigned component );
00063 
00064 void
00065 tgsi_util_set_src_register_extswizzle(
00066    struct tgsi_src_register_ext_swz *reg,
00067    unsigned swizzle,
00068    unsigned component );
00069 
00070 unsigned
00071 tgsi_util_get_src_register_extnegate(
00072    const struct tgsi_src_register_ext_swz *reg,
00073    unsigned component );
00074 
00075 void
00076 tgsi_util_set_src_register_extnegate(
00077    struct tgsi_src_register_ext_swz *reg,
00078    unsigned negate,
00079    unsigned component );
00080 
00081 #define TGSI_UTIL_SIGN_CLEAR    0   /* Force positive */
00082 #define TGSI_UTIL_SIGN_SET      1   /* Force negative */
00083 #define TGSI_UTIL_SIGN_TOGGLE   2   /* Negate */
00084 #define TGSI_UTIL_SIGN_KEEP     3   /* No change */
00085 
00086 unsigned
00087 tgsi_util_get_full_src_register_sign_mode(
00088    const struct tgsi_full_src_register *reg,
00089    unsigned component );
00090 
00091 void
00092 tgsi_util_set_full_src_register_sign_mode(
00093    struct tgsi_full_src_register *reg,
00094    unsigned sign_mode );
00095 
00096 #if defined __cplusplus
00097 }
00098 #endif
00099 
00100 #endif /* TGSI_UTIL_H */

Generated on Tue Sep 29 06:25:15 2009 for Gallium3D by  doxygen 1.5.4