aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/python
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2008-07-20 09:28:27 +0900
committerJosé Fonseca <[email protected]>2008-07-20 09:28:27 +0900
commit5853b6c2fe10223738a15d294e2a1605ec076953 (patch)
tree3a65fc904a15af896d367eb247eeab16e2ff3775 /src/gallium/state_trackers/python
parent43df2fe2d9fe242174aba58b5de191c3d1fff212 (diff)
python/tests: Check support for non-pot/non-square textures.
Diffstat (limited to 'src/gallium/state_trackers/python')
-rw-r--r--src/gallium/state_trackers/python/tests/texture.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/gallium/state_trackers/python/tests/texture.py b/src/gallium/state_trackers/python/tests/texture.py
index 861070c8d24..880a61306c9 100644
--- a/src/gallium/state_trackers/python/tests/texture.py
+++ b/src/gallium/state_trackers/python/tests/texture.py
@@ -94,7 +94,10 @@ def tex_coords(texture, face, level, zslice):
rz = -1.0
result.append([rx, ry, rz])
return result
-
+
+def is_pot(n):
+ return n & (n - 1) == 0
+
class TextureTest(TestCase):
@@ -136,7 +139,14 @@ class TextureTest(TestCase):
level = self.level
zslice = self.zslice
- if not dev.is_format_supported(format, target, PIPE_TEXTURE_USAGE_SAMPLER, 0):
+ tex_usage = PIPE_TEXTURE_USAGE_SAMPLER
+ geom_flags = 0
+ if width != height:
+ geom_flags |= PIPE_TEXTURE_GEOM_NON_SQUARE
+ if not is_pot(width) or not is_pot(height) or not is_pot(depth):
+ geom_flags |= PIPE_TEXTURE_GEOM_NON_POWER_OF_TWO
+
+ if not dev.is_format_supported(format, target, tex_usage, geom_flags):
raise TestSkip
ctx = self.dev.context_create()
@@ -199,7 +209,7 @@ class TextureTest(TestCase):
height = height,
depth = depth,
last_level = last_level,
- tex_usage = PIPE_TEXTURE_USAGE_SAMPLER,
+ tex_usage = tex_usage,
)
expected_rgba = FloatArray(height*width*4)