Sometimes we want to emit a relocation to a NULL surface when the
constructing the batch. If we push the NULL handling into the common
brw_emit_reloc() we can streamline the batch construction.

Cc: Kenneth Graunke <[email protected]>
Cc: Matt Turner <[email protected]>
Cc: Jason Ekstrand <[email protected]>
Cc: Daniel Vetter <[email protected]>
---
 src/mesa/drivers/dri/i965/intel_batchbuffer.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c 
b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
index 28c2f474c0..4ddce87c0f 100644
--- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c
+++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
@@ -756,6 +756,9 @@ brw_emit_reloc(struct intel_batchbuffer *batch, uint32_t 
batch_offset,
                struct brw_bo *target, uint32_t target_offset,
                uint32_t read_domains, uint32_t write_domain)
 {
+   if (!target)
+      return target_offset;
+
    uint64_t offset64;
 
    if (batch->reloc_count == batch->reloc_array_size) {
-- 
2.13.2

_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to