Mesa (master): python: Mask out PIPE_TEXTURE_USAGE_DISPLAY_TARGET usage.
Jose Fonseca
jrfonseca at kemper.freedesktop.org
Mon Jan 11 14:01:15 UTC 2010
Module: Mesa
Branch: master
Commit: f2f16720274bc0c2d2f2858c9ebc24abc97e3f41
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f2f16720274bc0c2d2f2858c9ebc24abc97e3f41
Author: José Fonseca <jfonseca at vmware.com>
Date: Mon Jan 11 13:57:12 2010 +0000
python: Mask out PIPE_TEXTURE_USAGE_DISPLAY_TARGET usage.
As displaying surfaces directly isn't supported by the python state
tracker.
---
src/gallium/state_trackers/python/p_device.i | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/src/gallium/state_trackers/python/p_device.i b/src/gallium/state_trackers/python/p_device.i
index 2dc995a..0eba488 100644
--- a/src/gallium/state_trackers/python/p_device.i
+++ b/src/gallium/state_trackers/python/p_device.i
@@ -87,6 +87,10 @@ struct st_device {
enum pipe_texture_target target,
unsigned tex_usage,
unsigned geom_flags ) {
+ /* We can't really display surfaces with the python statetracker so mask
+ * out that usage */
+ tex_usage &= ~PIPE_TEXTURE_USAGE_DISPLAY_TARGET;
+
return $self->screen->is_format_supported( $self->screen,
format,
target,
@@ -110,6 +114,11 @@ struct st_device {
unsigned tex_usage = 0
) {
struct pipe_texture templat;
+
+ /* We can't really display surfaces with the python statetracker so mask
+ * out that usage */
+ tex_usage &= ~PIPE_TEXTURE_USAGE_DISPLAY_TARGET;
+
memset(&templat, 0, sizeof(templat));
templat.format = format;
templat.width0 = width;
@@ -118,6 +127,7 @@ struct st_device {
templat.last_level = last_level;
templat.target = target;
templat.tex_usage = tex_usage;
+
return $self->screen->texture_create($self->screen, &templat);
}
More information about the mesa-commit
mailing list