summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_texture.c
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2010-05-11 13:57:11 +0100
committerJosé Fonseca <[email protected]>2010-05-11 14:00:01 +0100
commitb0427bedde80e3189524651a327235bdfddbc613 (patch)
treec41db798d6d4bbcbb7e07f20a39f828baa6df8d4 /src/mesa/state_tracker/st_texture.c
parentd99a7497ed383e0d7872b95f2aa63eff916680ea (diff)
mesa/st: Remove internal flushes from Mesa state tracker.
Now that transfers are context operations it is the driver's responsibility to ensure that transfers happen in order with all other context operations, so flushes and finishes inside Mesa should be no longer necessary. The attached patch implements that. This should proportionate significant improvements for hardware drivers which are able to stream transfers in the command buffers. You can use the softpipe/llvmpipe_flush_resource() as reference implementation of the worst case scenario, where the driver is not able to streamline transfers. But the expectation is that driver implementators will want to avoid flushing as much as possible.
Diffstat (limited to 'src/mesa/state_tracker/st_texture.c')
-rw-r--r--src/mesa/state_tracker/st_texture.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c
index 32011f294fa..2d364737cb0 100644
--- a/src/mesa/state_tracker/st_texture.c
+++ b/src/mesa/state_tracker/st_texture.c
@@ -29,7 +29,6 @@
#include "st_format.h"
#include "st_texture.h"
#include "st_cb_fbo.h"
-#include "st_inlines.h"
#include "main/enums.h"
#undef Elements /* fix re-defined macro warning */
@@ -145,7 +144,7 @@ st_texture_image_map(struct st_context *st, struct st_texture_image *stImage,
DBG("%s \n", __FUNCTION__);
- stImage->transfer = st_no_flush_get_tex_transfer(st, pt, stImage->face,
+ stImage->transfer = pipe_get_transfer(st->pipe, pt, stImage->face,
stImage->level, zoffset,
usage, x, y, w, h);
@@ -220,7 +219,7 @@ st_texture_image_data(struct st_context *st,
DBG("%s\n", __FUNCTION__);
for (i = 0; i < depth; i++) {
- dst_transfer = st_no_flush_get_tex_transfer(st, dst, face, level, i,
+ dst_transfer = pipe_get_transfer(st->pipe, dst, face, level, i,
PIPE_TRANSFER_WRITE, 0, 0,
u_minify(dst->width0, level),
u_minify(dst->height0, level));
@@ -320,19 +319,3 @@ st_texture_image_copy(struct pipe_context *pipe,
}
}
-
-void
-st_teximage_flush_before_map(struct st_context *st,
- struct pipe_resource *pt,
- unsigned int face,
- unsigned int level,
- enum pipe_transfer_usage usage)
-{
- struct pipe_context *pipe = st->pipe;
- unsigned referenced =
- pipe->is_resource_referenced(pipe, pt, face, level);
-
- if (referenced && ((referenced & PIPE_REFERENCED_FOR_WRITE) ||
- (usage & PIPE_TRANSFER_WRITE)))
- st->pipe->flush(st->pipe, PIPE_FLUSH_RENDER_CACHE, NULL);
-}