diff options
author | Kenneth Graunke <[email protected]> | 2018-06-19 23:37:10 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2019-02-21 10:26:07 -0800 |
commit | 26db2ea782eb52ad80739d73a8f4882eee576bda (patch) | |
tree | fbbd442deab5eb701b3fe97b4c6fac7ef5f90da5 /src/gallium | |
parent | a7770501a76680143713b3e123a181936956603a (diff) |
iris: avoid crashing on unbound constant resources
instead, read from the workaround BO
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/iris/iris_state.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index baa27e7cd49..1dc761caff6 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -2290,7 +2290,10 @@ iris_restore_context_saved_bos(struct iris_context *ice, struct iris_const_buffer *cbuf = &shs->constbuf[range->block]; struct iris_resource *res = (void *) cbuf->resource; - iris_use_pinned_bo(batch, res->bo, false); + if (res) + iris_use_pinned_bo(batch, res->bo, false); + else + iris_use_pinned_bo(batch, batch->screen->workaround_bo, false); } } @@ -2467,7 +2470,8 @@ iris_upload_render_state(struct iris_context *ice, pkt.ConstantBody.ReadLength[n] = range->length; pkt.ConstantBody.Buffer[n] = - ro_bo(res->bo, range->start * 32 + cbuf->offset); + res ? ro_bo(res->bo, range->start * 32 + cbuf->offset) + : ro_bo(batch->screen->workaround_bo, 0); n--; } } |