diff options
author | Eric Anholt <eric@anholt.net> | 2014-03-04 15:52:05 -0800 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2014-03-06 11:35:17 -0800 |
commit | c10896b593720457e99a731e9493ce8d6c497fab (patch) | |
tree | 48464424f0911d2d582c081a1561bb46f4d8349b /src/mesa/drivers/dri/i965/intel_fbo.h | |
parent | 1e25aa4cdb3bb1f190ea3905eb1d169e0c5a1ef0 (diff) | |
download | external_mesa3d-c10896b593720457e99a731e9493ce8d6c497fab.zip external_mesa3d-c10896b593720457e99a731e9493ce8d6c497fab.tar.gz external_mesa3d-c10896b593720457e99a731e9493ce8d6c497fab.tar.bz2 |
i965: Fix render-to-texture in non-FinishRenderTexture cases.
We've had several problems now with FinishRenderTexture not getting called
enough, and we're ready to just give up on it ever doing what we need. In
particular, an upcoming Steam title had rendering bugs that could be fixed
by always_flush_cache=true.
Instead of hoping Mesa core can figure out when we need to flush our
caches, just track what BOs we've rendered to in a set, and when we render
from a BO in that set, emit a flush and clear the set.
There's some overhead to keeping this set, but most of that is just
hashing the pointer -- it turns out our set never even gets very large,
because cache flushes are so common (even on cairo-gl).
No statistically significant performance difference in cairo-gl (n=100),
despite spending ~.5% CPU in these set operations.
v1: (Original patch by Eric Anholt.)
v2: (Changes by Ken Graunke.)
- Rebase forward from May 7th 2013 -> March 4th 2014.
- Drop the FinishRenderTexture hook entirely; after rebasing the
patch, the hook was just an empty function.
- Move the brw_render_cache_set_clear() call from
intel_batchbuffer_emit_flush() to brw_emit_pipe_control_flush().
In theory, this could catch more cases where we've flushed.
- Consider stencil as a possible texturing source.
v3: (changes by anholt):
- Move set_clear() back to emit_mi_flush() -- it means we can drop
more forced flushes from the code. In the previous location, it
wouldn't have been called when we wanted pre-gen6.
- Move the set clear from batch init to reset -- it should be empty at
the start of every batch, since the kernel handled any inter-batch
flush for us.
v4: Drop the debug code in set.c that I accidentally committed.
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Dylan Baker <baker.dylan.c@gmail.com> [v2]
Diffstat (limited to 'src/mesa/drivers/dri/i965/intel_fbo.h')
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_fbo.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_fbo.h b/src/mesa/drivers/dri/i965/intel_fbo.h index b8db7e2..fa457e2 100644 --- a/src/mesa/drivers/dri/i965/intel_fbo.h +++ b/src/mesa/drivers/dri/i965/intel_fbo.h @@ -237,6 +237,10 @@ void intel_renderbuffer_upsample(struct brw_context *brw, struct intel_renderbuffer *irb); +void brw_render_cache_set_clear(struct brw_context *brw); +void brw_render_cache_set_add_bo(struct brw_context *brw, drm_intel_bo *bo); +void brw_render_cache_set_check_flush(struct brw_context *brw, drm_intel_bo *bo); + unsigned intel_quantize_num_samples(struct intel_screen *intel, unsigned num_samples); |