summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_texture.c
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2010-05-17 21:19:03 +0200
committerRoland Scheidegger <[email protected]>2010-05-17 21:19:03 +0200
commit127328bfadaa5f080730fd41f404f1bc74f490d3 (patch)
treef3a8ad0d183e19a1fcd9f7bd70b77f49941dbac3 /src/mesa/state_tracker/st_texture.c
parent815b75705f5e3f0f7db025368da37bb14395de9a (diff)
mesa/st: adapt to interface changes
adapt to blit changes, and also handle a bit more msaa state in theory (incomplete, doesn't handle resolves in any way for now).
Diffstat (limited to 'src/mesa/state_tracker/st_texture.c')
-rw-r--r--src/mesa/state_tracker/st_texture.c37
1 files changed, 17 insertions, 20 deletions
diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c
index 6a42789b824..d0d1c5c3156 100644
--- a/src/mesa/state_tracker/st_texture.c
+++ b/src/mesa/state_tracker/st_texture.c
@@ -72,7 +72,7 @@ st_texture_create(struct st_context *st,
_mesa_lookup_enum_by_nr(format), last_level);
assert(format);
- assert(screen->is_format_supported(screen, format, target,
+ assert(screen->is_format_supported(screen, format, target, 0,
PIPE_BIND_SAMPLER_VIEW, 0));
memset(&pt, 0, sizeof(pt));
@@ -245,17 +245,19 @@ st_texture_image_copy(struct pipe_context *pipe,
struct pipe_resource *src,
GLuint face)
{
- struct pipe_screen *screen = pipe->screen;
GLuint width = u_minify(dst->width0, dstLevel);
GLuint height = u_minify(dst->height0, dstLevel);
GLuint depth = u_minify(dst->depth0, dstLevel);
- struct pipe_surface *src_surface;
- struct pipe_surface *dst_surface;
+ struct pipe_subresource dstsub, srcsub;
GLuint i;
assert(src->width0 == dst->width0);
assert(src->height0 == dst->height0);
+ dstsub.face = face;
+ dstsub.level = dstLevel;
+ srcsub.face = face;
+
for (i = 0; i < depth; i++) {
GLuint srcLevel;
@@ -271,6 +273,7 @@ st_texture_image_copy(struct pipe_context *pipe,
#if 0
{
+ struct pipe_screen *screen = pipe->screen;
src_surface = screen->get_tex_surface(screen, src, face, srcLevel, i,
PIPE_BUFFER_USAGE_CPU_READ);
ubyte *map = screen->surface_map(screen, src_surface, PIPE_BUFFER_USAGE_CPU_READ);
@@ -284,22 +287,16 @@ st_texture_image_copy(struct pipe_context *pipe,
pipe_surface_reference(&src_surface, NULL);
}
#endif
-
- dst_surface = screen->get_tex_surface(screen, dst, face, dstLevel, i,
- PIPE_BIND_BLIT_DESTINATION);
-
- src_surface = screen->get_tex_surface(screen, src, face, srcLevel, i,
- PIPE_BIND_BLIT_SOURCE);
-
- pipe->surface_copy(pipe,
- dst_surface,
- 0, 0, /* destX, Y */
- src_surface,
- 0, 0, /* srcX, Y */
- width, height);
-
- pipe_surface_reference(&src_surface, NULL);
- pipe_surface_reference(&dst_surface, NULL);
+ srcsub.level = srcLevel;
+
+ pipe->resource_copy_region(pipe,
+ dst,
+ dstsub,
+ 0, 0, i,/* destX, Y, Z */
+ src,
+ srcsub,
+ 0, 0, i,/* srcX, Y, Z */
+ width, height);
}
}