if (flags & SP_FLUSH_TEXTURE_CACHE) {
unsigned sh;
- for (sh = 0; sh < Elements(softpipe->tex_cache); sh++) {
+ for (sh = 0; sh < ARRAY_SIZE(softpipe->tex_cache); sh++) {
for (i = 0; i < softpipe->num_sampler_views[sh]; i++) {
sp_flush_tex_tile_cache(softpipe->tex_cache[sh][i]);
}
if (flags & PIPE_FLUSH_END_OF_FRAME) {
static unsigned frame_no = 1;
static char filename[256];
- util_snprintf(filename, sizeof(filename), "cbuf_%u.bmp", frame_no);
+ snprintf(filename, sizeof(filename), "cbuf_%u.bmp", frame_no);
debug_dump_surface_bmp(pipe, filename, softpipe->framebuffer.cbufs[0]);
- util_snprintf(filename, sizeof(filename), "zsbuf_%u.bmp", frame_no);
+ snprintf(filename, sizeof(filename), "zsbuf_%u.bmp", frame_no);
debug_dump_surface_bmp(pipe, filename, softpipe->framebuffer.zsbuf);
++frame_no;
}
* This is for illustrative purposes only, as softpipe does not
* have fences.
*/
- pipe->screen->fence_finish(pipe->screen, fence,
+ pipe->screen->fence_finish(pipe->screen, NULL, fence,
PIPE_TIMEOUT_INFINITE);
pipe->screen->fence_reference(pipe->screen, &fence, NULL);
}
return TRUE;
}
-void softpipe_texture_barrier(struct pipe_context *pipe)
+void softpipe_texture_barrier(struct pipe_context *pipe, unsigned flags)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
uint i, sh;
- for (sh = 0; sh < Elements(softpipe->tex_cache); sh++) {
+ for (sh = 0; sh < ARRAY_SIZE(softpipe->tex_cache); sh++) {
for (i = 0; i < softpipe->num_sampler_views[sh]; i++) {
sp_flush_tex_tile_cache(softpipe->tex_cache[sh][i]);
}
void softpipe_memory_barrier(struct pipe_context *pipe, unsigned flags)
{
- softpipe_texture_barrier(pipe);
+ if (!(flags & ~PIPE_BARRIER_UPDATE))
+ return;
+
+ softpipe_texture_barrier(pipe, 0);
}