st/python: Generate binding for u_format utility functions too.
authorJosé Fonseca <jfonseca@vmware.com>
Wed, 31 Mar 2010 11:28:12 +0000 (12:28 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Wed, 31 Mar 2010 12:12:24 +0000 (13:12 +0100)
src/gallium/state_trackers/python/gallium.i
src/gallium/state_trackers/python/u_format.i [new file with mode: 0644]

index 632d71ccbee73659d5c084f36ea951a32c18f6c1..aeed1cd118cc988357712bed768ffe8737775262 100644 (file)
@@ -95,7 +95,7 @@
 
 
 %include "p_compiler.i"
-%include "p_defines.h";
+%include "p_defines.h"
 %include "p_format.h"
 
 %include "p_device.i"
 %include "p_texture.i"
 %include "p_state.i"
 
+%include "u_format.i"
diff --git a/src/gallium/state_trackers/python/u_format.i b/src/gallium/state_trackers/python/u_format.i
new file mode 100644 (file)
index 0000000..2184b42
--- /dev/null
@@ -0,0 +1,88 @@
+/**************************************************************************
+ *
+ * Copyright 2010 VMware, Inc.
+ * 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 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
+ * THE COPYRIGHT HOLDERS, AUTHORS 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.
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ **************************************************************************/
+
+
+static INLINE const char *
+util_format_name(enum pipe_format format);
+
+static INLINE boolean
+util_format_is_s3tc(enum pipe_format format);
+
+static INLINE boolean
+util_format_is_depth_or_stencil(enum pipe_format format);
+
+static INLINE boolean
+util_format_is_depth_and_stencil(enum pipe_format format);
+
+
+uint
+util_format_get_blocksizebits(enum pipe_format format);
+
+uint
+util_format_get_blocksize(enum pipe_format format);
+
+uint
+util_format_get_blockwidth(enum pipe_format format);
+
+uint
+util_format_get_blockheight(enum pipe_format format);
+
+unsigned
+util_format_get_nblocksx(enum pipe_format format,
+                         unsigned x);
+
+unsigned
+util_format_get_nblocksy(enum pipe_format format,
+                         unsigned y);
+
+unsigned
+util_format_get_nblocks(enum pipe_format format,
+                        unsigned width,
+                        unsigned height);
+
+size_t
+util_format_get_stride(enum pipe_format format,
+                       unsigned width);
+
+size_t
+util_format_get_2d_size(enum pipe_format format,
+                        size_t stride,
+                        unsigned height);
+
+uint
+util_format_get_component_bits(enum pipe_format format,
+                               enum util_format_colorspace colorspace,
+                               uint component);
+
+boolean
+util_format_has_alpha(enum pipe_format format);
+
+
+unsigned
+util_format_get_nr_components(enum pipe_format format);
+
+