Module: Mesa
Branch: pipe-video
Commit: 1a238efe424c666d730ffe91c01f49415797a7ca
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1a238efe424c666d730ffe91c01f49415797a7ca

Author: Christian König <deathsim...@vodafone.de>
Date:   Sun Mar 20 19:00:50 2011 +0100

[g3dvl] fix power_of_two buffer with/height handling

---

 src/gallium/state_trackers/xorg/xvmc/surface.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/gallium/state_trackers/xorg/xvmc/surface.c 
b/src/gallium/state_trackers/xorg/xvmc/surface.c
index 799dac2..ef7ea92 100644
--- a/src/gallium/state_trackers/xorg/xvmc/surface.c
+++ b/src/gallium/state_trackers/xorg/xvmc/surface.c
@@ -232,8 +232,14 @@ Status XvMCCreateSurface(Display *dpy, XvMCContext 
*context, XvMCSurface *surfac
       return BadAlloc;
    }
    template.last_level = 0;
-   template.width0 = util_next_power_of_two(context->width);
-   template.height0 = util_next_power_of_two(context->height);
+   if (vpipe->get_param(vpipe, PIPE_CAP_NPOT_TEXTURES)) {
+      template.width0 = context->width;
+      template.height0 = context->height;
+   }
+   else {
+      template.width0 = util_next_power_of_two(context->width);
+      template.height0 = util_next_power_of_two(context->height);
+   }
    template.depth0 = 1;
    template.array_size = 1;
    template.usage = PIPE_USAGE_DEFAULT;

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to