util_format_short_name(base->format));
tex->buffer = rws->buffer_create(rws, 2048,
- PIPE_BIND_SAMPLER_VIEW, /* XXX */
+ base->bind,
tex->size);
rws->buffer_set_tiling(rws, tex->buffer,
tex->pitch[0],
struct r300_transfer *trans;
struct pipe_resource base;
+ /* XXX Why aren't flushes taken care of by winsys automatically?
+ * Winsys seems to sometimes return a cached buffer instead of
+ * a mapped hardware buffer if this flush is commented out. */
+ if (ctx->is_resource_referenced(ctx, texture, sr.face, sr.level))
+ ctx->flush(ctx, PIPE_FLUSH_RENDER_CACHE, NULL);
+
trans = CALLOC_STRUCT(r300_transfer);
if (trans) {
/* Initialize the transfer object. */