aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/g3dvl/vl_surface.c
diff options
context:
space:
mode:
authorYounes Manton <[email protected]>2008-06-18 22:21:11 -0400
committerYounes Manton <[email protected]>2008-06-30 10:11:02 -0400
commit0a6aec8c0f2173cfb95ce95d12b66f090ea0ba1f (patch)
treec56b7bf6870e9258378ee653b19d08e7f1913aaa /src/gallium/state_trackers/g3dvl/vl_surface.c
parent14d4f9e44e55e2b427579ed6788e579d70b289e7 (diff)
g3dvl: Work around SP tex cache bug, specify resource usage flags.
Diffstat (limited to 'src/gallium/state_trackers/g3dvl/vl_surface.c')
-rw-r--r--src/gallium/state_trackers/g3dvl/vl_surface.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/gallium/state_trackers/g3dvl/vl_surface.c b/src/gallium/state_trackers/g3dvl/vl_surface.c
index 3f59d0f1551..6451e54953d 100644
--- a/src/gallium/state_trackers/g3dvl/vl_surface.c
+++ b/src/gallium/state_trackers/g3dvl/vl_surface.c
@@ -31,7 +31,7 @@ static int vlGrabBlocks
0, 0, 0, PIPE_BUFFER_USAGE_CPU_WRITE
);
- texels = pipe_surface_map(tex_surface, 0);
+ texels = pipe_surface_map(tex_surface, PIPE_BUFFER_USAGE_CPU_WRITE);
for (b = 0; b < 4; ++b)
{
@@ -131,7 +131,7 @@ static int vlGrabBlocks
0, 0, 0, PIPE_BUFFER_USAGE_CPU_WRITE
);
- texels = pipe_surface_map(tex_surface, 0);
+ texels = pipe_surface_map(tex_surface, PIPE_BUFFER_USAGE_CPU_WRITE);
if ((coded_block_pattern >> (b + 4)) & 1)
{
@@ -165,6 +165,9 @@ static int vlGrabBlocks
pipe_surface_unmap(tex_surface);
}
+ /* XXX: Texture cache is not invalidated when texture contents change */
+ context->pipe->flush(context->pipe, PIPE_FLUSH_TEXTURE_CACHE, NULL);
+
return 0;
}
@@ -265,7 +268,7 @@ int vlRenderIMacroBlock
(
pipe->screen,
surface->texture,
- 0, 0, 0, PIPE_BUFFER_USAGE_CPU_READ | PIPE_BUFFER_USAGE_CPU_WRITE
+ 0, 0, 0, PIPE_BUFFER_USAGE_GPU_READ | PIPE_BUFFER_USAGE_GPU_WRITE
);
pipe->set_framebuffer_state(pipe, &surface->context->states.mc.render_target);
pipe->set_sampler_textures(pipe, 3, surface->context->states.mc.textures);
@@ -346,7 +349,7 @@ int vlRenderPMacroBlock
(
pipe->screen,
surface->texture,
- 0, 0, 0, PIPE_BUFFER_USAGE_CPU_READ | PIPE_BUFFER_USAGE_CPU_WRITE
+ 0, 0, 0, PIPE_BUFFER_USAGE_GPU_READ | PIPE_BUFFER_USAGE_GPU_WRITE
);
pipe->set_framebuffer_state(pipe, &surface->context->states.mc.render_target);
@@ -434,7 +437,7 @@ int vlRenderBMacroBlock
(
pipe->screen,
surface->texture,
- 0, 0, 0, PIPE_BUFFER_USAGE_CPU_READ | PIPE_BUFFER_USAGE_CPU_WRITE
+ 0, 0, 0, PIPE_BUFFER_USAGE_GPU_READ | PIPE_BUFFER_USAGE_GPU_WRITE
);
pipe->set_framebuffer_state(pipe, &surface->context->states.mc.render_target);
@@ -510,6 +513,7 @@ int vlPutSurface
destw,
desth,
PIPE_FORMAT_A8R8G8B8_UNORM,
+ /*XXX: SoftPipe doesn't change GPU usage to CPU like it does for textures */
PIPE_BUFFER_USAGE_CPU_READ | PIPE_BUFFER_USAGE_CPU_WRITE,
0
);