summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2018-12-09 23:12:33 -0800
committerKenneth Graunke <[email protected]>2019-02-21 10:26:12 -0800
commit9b1126c9904598e67148d930f3f79d0de0914c20 (patch)
tree2ded5736a0be6d86889c152c70ef8ef2121a3143 /src
parent45f4dab62bd7c4daf9d9fc357f4ed1275445f13a (diff)
iris: disable aux for external things
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/iris/iris_resource.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c
index 746de83f057..badf29542e3 100644
--- a/src/gallium/drivers/iris/iris_resource.c
+++ b/src/gallium/drivers/iris/iris_resource.c
@@ -206,6 +206,7 @@ iris_resource_disable_aux(struct iris_resource *res)
// XXX: HiZ
res->aux.usage = ISL_AUX_USAGE_NONE;
+ res->aux.possible_usages = 1 << ISL_AUX_USAGE_NONE;
res->aux.surf.size_B = 0;
res->aux.bo = NULL;
res->aux.state = NULL;
@@ -730,11 +731,23 @@ iris_resource_get_handle(struct pipe_screen *pscreen,
struct winsys_handle *whandle,
unsigned usage)
{
+ struct iris_context *ice = (struct iris_context *)ctx;
struct iris_resource *res = (struct iris_resource *)resource;
/* If this is a buffer, stride should be 0 - no need to special case */
whandle->stride = res->surf.row_pitch_B;
- whandle->modifier = tiling_to_modifier(res->bo->tiling_mode);
+ whandle->modifier =
+ res->mod_info ? res->mod_info->modifier
+ : tiling_to_modifier(res->bo->tiling_mode);
+
+ if (!res->mod_info || res->mod_info->aux_usage != res->aux.usage) {
+ struct iris_batch *render_batch = &ice->batches[IRIS_BATCH_RENDER];
+ iris_resource_prepare_access(ice, render_batch, res,
+ 0, INTEL_REMAINING_LEVELS,
+ 0, INTEL_REMAINING_LAYERS,
+ ISL_AUX_USAGE_NONE, false);
+ iris_resource_disable_aux(res);
+ }
switch (whandle->type) {
case WINSYS_HANDLE_TYPE_SHARED: