summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/python
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2008-07-19 12:04:37 +0900
committerJosé Fonseca <[email protected]>2008-07-19 12:32:29 +0900
commit8aafc03b260ab8923f1b373f7effa75bcdb40a72 (patch)
tree0274cc6cad2d6993ba8ea3fdd34c49254c532d47 /src/gallium/state_trackers/python
parentff26c50153b3a348b35843262ceb27062ab37214 (diff)
gallium: Finer grained is_format_supported.
Diffstat (limited to 'src/gallium/state_trackers/python')
-rw-r--r--src/gallium/state_trackers/python/gallium.i15
-rw-r--r--src/gallium/state_trackers/python/samples/tri.py8
-rw-r--r--src/gallium/state_trackers/python/tests/texture.py13
3 files changed, 24 insertions, 12 deletions
diff --git a/src/gallium/state_trackers/python/gallium.i b/src/gallium/state_trackers/python/gallium.i
index c08ac87acae..8d8b762ea57 100644
--- a/src/gallium/state_trackers/python/gallium.i
+++ b/src/gallium/state_trackers/python/gallium.i
@@ -158,8 +158,15 @@ struct st_context {
* drawing surface.
* \param type one of PIPE_TEXTURE, PIPE_SURFACE
*/
- int is_format_supported( enum pipe_format format, unsigned type ) {
- return $self->screen->is_format_supported( $self->screen, format, type);
+ int is_format_supported( enum pipe_format format,
+ enum pipe_texture_target target,
+ unsigned tex_usage,
+ unsigned geom_flags ) {
+ return $self->screen->is_format_supported( $self->screen,
+ format,
+ target,
+ tex_usage,
+ geom_flags );
}
struct st_context *
@@ -175,7 +182,7 @@ struct st_context {
unsigned depth = 1,
unsigned last_level = 0,
enum pipe_texture_target target = PIPE_TEXTURE_2D,
- unsigned usage = 0
+ unsigned tex_usage = 0
) {
struct pipe_texture templat;
memset(&templat, 0, sizeof(templat));
@@ -186,7 +193,7 @@ struct st_context {
templat.depth[0] = depth;
templat.last_level = last_level;
templat.target = target;
- templat.tex_usage = usage;
+ templat.tex_usage = tex_usage;
return $self->screen->texture_create($self->screen, &templat);
}
diff --git a/src/gallium/state_trackers/python/samples/tri.py b/src/gallium/state_trackers/python/samples/tri.py
index 36659229298..1271c67627d 100644
--- a/src/gallium/state_trackers/python/samples/tri.py
+++ b/src/gallium/state_trackers/python/samples/tri.py
@@ -140,9 +140,11 @@ def test(dev):
ctx.set_clip(clip)
# framebuffer
- cbuf = dev.texture_create(PIPE_FORMAT_X8R8G8B8_UNORM,
- width, height,
- usage=PIPE_TEXTURE_USAGE_DISPLAY_TARGET)
+ cbuf = dev.texture_create(
+ PIPE_FORMAT_X8R8G8B8_UNORM,
+ width, height,
+ tex_usage=PIPE_TEXTURE_USAGE_DISPLAY_TARGET,
+ )
_cbuf = cbuf.get_surface(usage = PIPE_BUFFER_USAGE_GPU_READ|PIPE_BUFFER_USAGE_GPU_WRITE)
fb = Framebuffer()
fb.width = width
diff --git a/src/gallium/state_trackers/python/tests/texture.py b/src/gallium/state_trackers/python/tests/texture.py
index 16ad78c8aa8..b2ca9f416f5 100644
--- a/src/gallium/state_trackers/python/tests/texture.py
+++ b/src/gallium/state_trackers/python/tests/texture.py
@@ -136,7 +136,7 @@ class TextureTest(TestCase):
level = self.level
zslice = self.zslice
- if not dev.is_format_supported(format, PIPE_TEXTURE):
+ if not dev.is_format_supported(format, PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_SAMPLER, 0):
raise TestSkip
ctx = self.dev.context_create()
@@ -199,6 +199,7 @@ class TextureTest(TestCase):
height = height,
depth = depth,
last_level = last_level,
+ tex_usage = PIPE_TEXTURE_USAGE_SAMPLER,
)
expected_rgba = FloatArray(height*width*4)
@@ -212,10 +213,12 @@ class TextureTest(TestCase):
ctx.set_sampler_texture(0, texture)
# framebuffer
- cbuf_tex = dev.texture_create(PIPE_FORMAT_A8R8G8B8_UNORM,
- width,
- height,
- usage = PIPE_TEXTURE_USAGE_RENDER_TARGET)
+ cbuf_tex = dev.texture_create(
+ PIPE_FORMAT_A8R8G8B8_UNORM,
+ width,
+ height,
+ tex_usage = PIPE_TEXTURE_USAGE_RENDER_TARGET,
+ )
cbuf = cbuf_tex.get_surface(usage = PIPE_BUFFER_USAGE_GPU_WRITE|PIPE_BUFFER_USAGE_GPU_READ)
fb = Framebuffer()