python: Mask out PIPE_TEXTURE_USAGE_DISPLAY_TARGET usage.
authorJosé Fonseca <jfonseca@vmware.com>
Mon, 11 Jan 2010 13:57:12 +0000 (13:57 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Mon, 11 Jan 2010 14:01:07 +0000 (14:01 +0000)
As displaying surfaces directly isn't supported by the python state
tracker.

src/gallium/state_trackers/python/p_device.i

index 2dc995adb07687ba7e1a1835d8fd36ae51fe9b71..0eba488a078e606d8e2a34b47918ce95bee99fef 100644 (file)
@@ -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);
    }