summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2010-02-14 23:24:08 +0000
committerJosé Fonseca <jfonseca@vmware.com>2010-02-14 23:25:34 +0000
commitc2b0484e58765eadb7afc676ecffd80ebc1cbe5b (patch)
tree2d8c431e75317849330dc71cd58ca3b3caa88439 /src/gallium/state_trackers
parent165b824343e77775b416f8dec16f744ffaf39aea (diff)
python: Pretty-printing of blend state.
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/python/gallium.i4
-rw-r--r--src/gallium/state_trackers/python/p_state.i16
2 files changed, 19 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/python/gallium.i b/src/gallium/state_trackers/python/gallium.i
index d45c8bb0a5..ffb084e358 100644
--- a/src/gallium/state_trackers/python/gallium.i
+++ b/src/gallium/state_trackers/python/gallium.i
@@ -41,13 +41,15 @@
#include "pipe/p_screen.h"
#include "pipe/p_context.h"
#include "pipe/p_shader_tokens.h"
-#include "cso_cache/cso_context.h"
+#include "os/os_stream.h"
#include "util/u_inlines.h"
#include "util/u_draw_quad.h"
#include "util/u_tile.h"
#include "util/u_math.h"
#include "util/u_format.h"
+#include "util/u_dump.h"
#include "util/u_memory.h"
+#include "cso_cache/cso_context.h"
#include "tgsi/tgsi_text.h"
#include "tgsi/tgsi_dump.h"
diff --git a/src/gallium/state_trackers/python/p_state.i b/src/gallium/state_trackers/python/p_state.i
index 318fe1c463..b80e46bd0d 100644
--- a/src/gallium/state_trackers/python/p_state.i
+++ b/src/gallium/state_trackers/python/p_state.i
@@ -58,6 +58,22 @@
};
+%extend pipe_blend_state
+{
+ %cstring_output_allocate_size(char **STRING, int *LENGTH, os_free(*$1));
+ void __str__(char **STRING, int *LENGTH)
+ {
+ struct os_stream *stream;
+
+ stream = os_str_stream_create(1);
+ util_dump_blend_state(stream, $self);
+
+ *STRING = os_str_stream_get_and_close(stream);
+ *LENGTH = strlen(*STRING);
+ }
+};
+
+
%extend pipe_framebuffer_state {
pipe_framebuffer_state(void) {