/** Get a surface which is a "view" into a texture */
struct pipe_surface *
- get_surface(unsigned face=0, unsigned level=0, unsigned zslice=0, unsigned usage=0 )
+ get_surface(unsigned face=0, unsigned level=0, unsigned zslice=0 )
{
+ const usage = PIPE_BUFFER_USAGE_GPU_READ_WRITE;
struct pipe_screen *screen = $self->screen;
return screen->get_tex_surface(screen, $self, face, level, zslice, usage);
}
pass
def get_tex_surface(self, texture, face, level, zslice, usage):
- return texture.get_surface(face, level, zslice, usage)
+ return texture.get_surface(face, level, zslice)
def tex_surface_destroy(self, surface):
self.interpreter.unregister_object(surface)
width, height,
tex_usage=PIPE_TEXTURE_USAGE_DISPLAY_TARGET,
)
- _cbuf = cbuf.get_surface(usage = PIPE_BUFFER_USAGE_GPU_READ|PIPE_BUFFER_USAGE_GPU_WRITE)
+ _cbuf = cbuf.get_surface()
fb = Framebuffer()
fb.width = width
fb.height = height
ctx.flush()
- show_image(cbuf.get_surface(usage = PIPE_BUFFER_USAGE_CPU_READ|PIPE_BUFFER_USAGE_CPU_WRITE))
- #save_image('tri.png', cbuf.get_surface(usage = PIPE_BUFFER_USAGE_CPU_READ|PIPE_BUFFER_USAGE_CPU_WRITE))
+ show_image(cbuf.get_surface())
+ #save_image('tri.png', cbuf.get_surface())
expected_rgba = FloatArray(height*width*4)
texture.get_surface(
- usage = PIPE_BUFFER_USAGE_CPU_READ|PIPE_BUFFER_USAGE_CPU_WRITE,
face = face,
level = level,
zslice = zslice,
tex_usage = PIPE_TEXTURE_USAGE_RENDER_TARGET,
)
- cbuf = cbuf_tex.get_surface(usage = PIPE_BUFFER_USAGE_GPU_WRITE|PIPE_BUFFER_USAGE_GPU_READ)
+ cbuf = cbuf_tex.get_surface()
fb = Framebuffer()
fb.width = width
fb.height = height
ctx.flush()
- cbuf = cbuf_tex.get_surface(usage = PIPE_BUFFER_USAGE_CPU_READ)
+ cbuf = cbuf_tex.get_surface()
total = h*w
different = cbuf.compare_tile_rgba(x, y, w, h, expected_rgba, tol=4.0/256)