aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRafael Antognolli <[email protected]>2019-02-19 17:08:14 -0800
committerKenneth Graunke <[email protected]>2019-02-21 10:26:12 -0800
commit95589652a1035966ef5118b3eb6422bbbc8175dd (patch)
treefc9c8101de20db7c25df8aa5a3955112e22ce723 /src
parent36138bb7fcc2d98cb77d7d084052cf48ffcd84f0 (diff)
iris: Skip resolve if there's no context.
If iris_resource_get_handle() gets called without a context, we can't resolve the resource. Hopefully it shouldn't be compressed anyway, so let's just add an assert to ensure it's correct.
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/iris/iris_resource.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c
index d305dbf34cf..2184ac17082 100644
--- a/src/gallium/drivers/iris/iris_resource.c
+++ b/src/gallium/drivers/iris/iris_resource.c
@@ -760,13 +760,21 @@ iris_resource_get_handle(struct pipe_screen *pscreen,
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) {
+ if (ctx &&
+ (!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);
+ } else {
+ if (res->aux.usage != ISL_AUX_USAGE_NONE) {
+ enum isl_aux_state aux_state =
+ iris_resource_get_aux_state(res, 0, 0);
+ assert(aux_state == ISL_AUX_STATE_RESOLVED ||
+ aux_state == ISL_AUX_STATE_PASS_THROUGH);
+ }
}
switch (whandle->type) {