diff options
author | Jordan Justen <[email protected]> | 2016-10-21 15:46:37 +0100 |
---|---|---|
committer | Lionel Landwerlin <[email protected]> | 2016-11-08 16:13:57 +0000 |
commit | c0f505c7ef179249673e764de51b969e07fc8194 (patch) | |
tree | fc8f09532fe15ee329c880fdbfa24fea75d466a4 /src/mesa/drivers/dri/i965/brw_context.c | |
parent | c53e9c97802ce3041d2da380f90ec7fc41a9f5b0 (diff) |
i965: Add function to indicate when sampling with hiz is supported
Currently it indicates that this is never supported, but soon it will
be supported for gen8+^w gen9+
v2 by Ben:
- Explicitly disable aux_hiz for gen < 9 (with comment)
- squashed in next patch to avoid unused and useless functions
i965: Support sampling with hiz during rendering
For gen8, we can sample from depth while using the hiz buffer. This
allows us to sample depth without resolving from hiz to the depth
texture.
To do this we must resolve to hiz before drawing so we can use the hiz
buffer to sample while rendering. Hopefully the hiz buffer will
already be resolved in most cases because it was previously rendered,
meaning the hiz resolve is a no-op.
Note that this is still controlled by the
intel_miptree_sample_with_hiz function, and we will enable hiz
sampling for gen8 in a separate patch.
Signed-off-by: Jordan Justen <[email protected]>
Reviewed-by: Topi Pohjolainen <[email protected]>
Signed-off-by: Jordan Justen <[email protected]> (v1)
Signed-off-by: Ben Widawsky <[email protected]> (v2)
Reviewed-by: Topi Pohjolainen <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_context.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_context.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 3085a985517..a01decdb2f1 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -254,7 +254,10 @@ intel_update_state(struct gl_context * ctx, GLuint new_state) tex_obj = intel_texture_object(ctx->Texture.Unit[i]._Current); if (!tex_obj || !tex_obj->mt) continue; - intel_miptree_all_slices_resolve_depth(brw, tex_obj->mt); + if (intel_miptree_sample_with_hiz(brw, tex_obj->mt)) + intel_miptree_all_slices_resolve_hiz(brw, tex_obj->mt); + else + intel_miptree_all_slices_resolve_depth(brw, tex_obj->mt); /* Sampling engine understands lossless compression and resolving * those surfaces should be skipped for performance reasons. */ |